13

Tip #172   Create daily backups

To create a set of backed up files with the current date added at the end of the file name try the following:

ls *txt | sed "s/.*/cp & &.$(date "+%Y%d%m")/"


This will run the following commands:

cp 1.txt 1.txt.20082703

cp 2.txt 2.txt.20082703
cp 3.txt 3.txt.20082703