Rename Folder with Current Date
I have a backup server that mirrors the contents of another server every night. I do this with a little script I wrote which uses the mirrordir command. Then Cron runs this script on a daily schedule. I'd like to modify this arrangement so I can keep three weeks worth of history. So my plan is to create three scripts which will use the same mirrordir command, but will place the backups in one of three separate folders. My problem is that I need the script to rename the
folder with the current date. Does anyone know the command for this?
Use 'mv' with the 'date' command.
mv tommy tommy-`date +%m.%d.%Y` This would result in a folder called
Thank you so much Tommy.
Have a Linux Problem
Linux Books
Linux Home: Linux System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|