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 -)

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

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

Read an rysnc how to.