Copy files, preserve dates and permissions in unix

tar and feathers

This is a way to copy files in unix and keep the same time stamps, using the tar package:

tar cf – . | (cd wherever; tar -xvf -)

e.g.
change directory to path of USB stick and use:
tar cf – . | (cd /space/BACKUP/UDISK/;tar -xvf -)

kitchen rysnc

This is a another way to make a copy of a directory, the same command can be used again later to update the copy with any new files from the target directory:

rsync -va directory ~/BACKUP

e.g.
rsync -va /media/MJP_8GB_Ext2/mathew/ /space/BACKUP/8GB-disk/

Read an rysnc how to.

Advertisements

One Response

  1. truth is, i wanted to go punting in cambridge but when i checked the best places to go on punternet.com i ended up up to me nuts in guts as it were

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: