I have debian 7 x64.

I want to automatically zip a directory /ftb and place it in a directory /backup. I want it to be named Backup: (system date). I used apt-get install to install zip package, so I can use that to zip a file.

For example, if it were created on February third, 2014 it would be named Backup: 2/3/14 and placed in /backup.

Is this possible?

1 Answer 1


Yes. You can create a script that will do what you want and run it via cron.

The script would be something like this

zip -r /backup/Backup-$(date +%Y-%m-%d) /ftb

Which will create a file with the name Backup-2013-12-31, which is located in /backup, and have the contents of the /ftb directory

Then you can make the script executable, and add it into the crontab to run the script daily or however often you run it.

To do it daily, you could just use the daily directive in the crontab -
run crontab, and then add the following line

@daily /path/to/backup/script
  • Awesome script, I love it. Using it to backup my home partition, and my www folder, and mysql folder.
    – crosenblum
    Apr 24, 2014 at 20:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .