3
votes
2answers
63 views

Can I safely read a file that is appended to by another process?

If process A copies files to some location loc and process B regularly copies the files from loc to some other location, can B read a file that is currently in the process of being copied to loc by A? ...
2
votes
1answer
116 views

How to copy files *to* a camera?

I'd like to copy a firmware update file to my Canon 7D camera. After it was auto-mounted by thunar + thunar-volman + gvfs-gphoto2 I tried the following: $ cp eos7d-v205-win/7D000205.FIR ...
2
votes
1answer
230 views

Copy files based on date/time from subset of directories

I'm teaching a class where (~80) students are submitting assignments that I can access via webdav, organized by student in directories named by their unique identifier. The students are split into ...
3
votes
1answer
507 views

File inheriting permission of directory it is copied in?

I have files created into my home directory with only user read permission (r-- --- ---). I want to copy this file to another directory /etc/test/ which has the folder permission of 744 (rwx r-- r--). ...
1
vote
1answer
32 views

How to ignore files if there is an similar file with the same size?

I want to list the files in a directory, using ls. Typically, the files in that directory have the same name (except for the extension - one has extension .rej, one has .failed) . If a pair of files ...
5
votes
3answers
2k views

How do you compare two folders and copy the difference to a third folder?

You've got three folders: folder current, which contains your current files folder old, which contains an older version of the same files folder difference, which is just an empty folder How do ...
2
votes
2answers
89 views

Replicate a directory and file names n times

I have folder which has some data (files) in that with the name 201311261418 And a file 201311261418.eob In my scenario I need to replicate this folder and file names n times with the appended ...
8
votes
1answer
257 views

Do any archive utilities exist that can preserve the date created file attribute on NTFS-3G?

I tried the -X switch on zip, but that did not save the date created attribute. I can get it using this method. When a file is added to a zip archive using 7-Zip, it preserves the date created and ...
3
votes
0answers
57 views

How do I recursively set the date created attribute to the date modified attribute on NTFS-3G?

In my first question, I asked how to get the "Date created" field in NTFS-3G. Now, that I know I can get the "Date created", I have started adding files onto my NTFS-3G partition and would like to set ...
20
votes
1answer
573 views

How to move a directory, file by file? (instead of “copy then remove”)

My computer has one 500GB drive. I want to move 400GB of data from /unencrypted to /encrypted. Both directories are on the same partition, but /encrypted is handled by ecryptfs, so mv /uncrypted/* ...
1
vote
1answer
96 views

Will files created under source directory after running `cp` be copied?

Suppose I use cp to copy a directory to another place. If the process takes long, and I create a new file under the source directory, will it be copied, or does it depend on something?
2
votes
2answers
884 views

How to make duplicates with different names from a single file? [closed]

I want to duplicate the contents of a file. Suppose there is a file named "Hydrogen.element". I want to duplicate the contents of this file with a different name ie.make another file named ...
3
votes
2answers
791 views

How to add/replace only modified/updated files recursively for some 2 folders?

So I currently do stuff like: rm -rf ../../../$CLOUD_INSTALL_SUBDIR/lib_boost mkdir ../../../$CLOUD_INSTALL_SUBDIR/lib_boost cp -r ../../../$BOOST_ROOT_DIR/$BOOST_INSTALL_SUBDIR/lib/* ...
5
votes
1answer
3k views

bash force copy over same file

Our sysadmin has created a backup system that creates snapshots of the hard drive. When I try to restore an older version from the snapshot: cp /path/to/snapshots/foo.bar /path/to/folder/foo.bar ...
0
votes
1answer
927 views

How to copy files nested in directories that match a pattern?

I'm looking to copy files from subdirectories that match this pattern vendor/plugin/*/tasks/*.rake into a folder lib/tasks I think that this could be done several ways, but wanted to see if a ...