Results 1 to 3 of 3
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-11-2011 #1
problem: Adding date into cron job
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-11-2011 #2Just Joined!
- Join Date
- Aug 2009
- Location
- Toronto
- Posts
- 31
Try the following
cp /var/www/html/site1/module.txt /home/amitha/Desktop/backup/module.'date +%F'.txt
- 03-12-2011 #3
hi amlife,
Thanks for the reply. I tried what u say but it gives only the following result not the date.
file name: date +%F.module.txt


Reply With Quote