Siraj Sayeed

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/

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...