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.
For example, a folder called "tommy" could be renamed with the current
date by typing
mv tommy tommy-`date +%m.%d.%Y`
This would result in a folder called
tommy-06.15.2005. Note that the characters around the 'date' command
are accent marks.
Thank you so much Tommy.
The command I was using (that didn't work) was the one you spelled
out, but rather than using accent marks I used an apostrophe.
Quick Links:
Have a Linux Problem
Do
you have a Linux Question?
Linux Books
Linux Certification,
System Administration, Programming, Networking Books
Linux Home: Linux System Administration Hints and Tips
(c) www.sap-basis-abap.com All material on this site is
Copyright.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
All product names are trademarks of their respective
companies.
The site www.sap-basis-abap.com is in no way affiliated
with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.