I have an USB drive for backup/restore, and the following directories which have to be synced:
I want to copy all files from the first raspiProgs dir to the 2nd raspiProgs dir.
is the following command correct for this purpose?
Code: Select all
sudo cp -rf /media/pi/USB120DRV/sav/raspi_sav/raspiProgs /home/pi/raspiProgs
can I extend this command so that only those files will be copied,
a) if a file in dir2 ist not existing at all, or
b) if a file in dir1 is newer than a similar one in dir2? (overwrite only if newer),
c) and additionally, identical files (by name and date) have to be ignored