Results 1 to 3 of 3
Hello,
I'm not an advanced linux user though I've been using for years, here's my question.
I'm trying to setup a cron job to backup my websites daily, normally when ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-10-2009 #1Just Joined!
- Join Date
- Dec 2005
- Posts
- 9
how to use date command in filenaming for cron job?
Hello,
I'm not an advanced linux user though I've been using for years, here's my question.
I'm trying to setup a cron job to backup my websites daily, normally when I manually do this I include the date in the name of the created file, like: website-12-10-09.tar.gz
now I'm wondering if there is a way to dynamically include the date, something like:
tar -zcvf websites[date '+-%d-%m-%y'].tar.gz websites/
any ideas would be great!
cheers,
-Ken
- 12-10-2009 #2Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
You're real close. It would be:
Code:tar -zcvf websites`date '+-%d-%m-%y'`.tar.gz websites/
- 12-10-2009 #3Just Joined!
- Join Date
- Dec 2005
- Posts
- 9
hehe,, yes I knew it was something simple but wasn't sure of the syntax. but that did the trick!
much appreciated!


Reply With Quote
