Scratch Paper

September 8, 2007

Quick backup with GNU cp

Filed under: Uncategorized — Mark @ 8:02 am

I have been using unison to synchronize a work laptop with my $HOME at work. Unison seems to work very well between Ubuntu and Solaris once you have the same version of unison on both ends.

At home, I tried with unison to backup all the $HOMEs on our main PC to an external disk. I was too tired last night to figure out why unison appeared to be able to figure out what needed to be copied, but then failed to copy anything.

This morning I was looking at the GNU cp man page. It turns out that if you are going one way, just making a backup, GNU cp has not only the -p option to preserve file attributes like mode and timestamp, but also has the -u option:

-u, –update
copy only when the SOURCE file is newer than the destination
file or when the destination file is missing

Nice. Especially for someone who is too lazy to do things right.

Update: Well, here’s what I get for trying to use FAT32 on the external drive so I can share it between systems:

File size limit exceeded (core dumped)

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.


Powered by WordPress