Results 1 to 4 of 4
Hi,
I tried to write a cron job in Fedora13 as follows
-------------------------------------------------------------------------------------------------------
#!/bin/bash
today='date +%d%m%Y'
cp /var/www/html/site1/module.txt /home/amitha/Desktop/backup/$today.module.txt
---------------------------------------------------------------------------------------------------------
I want the module file in the html folder to ...
- 03-12-2011 #1
Date in the file name(cron)
Hi,
I tried to write a cron job in Fedora13 as follows
-------------------------------------------------------------------------------------------------------
#!/bin/bash
today='date +%d%m%Y'
cp /var/www/html/site1/module.txt /home/amitha/Desktop/backup/$today.module.txt
---------------------------------------------------------------------------------------------------------
I want the module file in the html folder to be backed up by attaching the date to it's name but it's not working properly
an advice is appreciated
thanks
amitha
- 03-12-2011 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Well, you are using regular single quote characters in today='date +%d%m%Y' but you need to us backquotes as in today=`date +%d%m%Y`
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 03-14-2011 #3
Thanks !!!
Hi Rubberman,
Thanks a lot for the help It works perfectly
Thanks and Regards
amitha
- 03-14-2011 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Happy to help.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote