Linux
Backup with cp on Linux
by Siraj Sayeed on Feb.03, 2009, under Linux
In one of our Linux servers, I had to overwrite a large number of files but at the same time I needed to maintain backup copies of the files that are being replaced. The number of files and folders were too many to do it manually and I am not an expert on scripting. After some searching I found a very simple option for cp which does the trick. It renames all the files with ‘_old’ prefix and then copies the source over to destination recursively.
sudo cp -rb -S_old /data01/source/* /data01/destination/