Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Setting Date Variable for Cron Job

I am now trying to learn to use Cron to do various kinds of backups. I have worked my way through all of the standard copying and TARing kinds of backups, but I wanted to go one step further and create regular  dated backups of some of my key configuration files. After a considerable amount of delving through the Linux books I have on hand, I came up with this sort of command (as an example):

cp -f /home/chuck/.emacs /home/chuck/Documents/programming/emacs-`date+"%Y%m%d"`.txt

But it the "%Y%m%d" does not convert into a date. Perhap I need to do some kind of variable declaration in a prior line? Or do I simply have the wrong syntax?



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links