Auto-saving a file at regular intervals

editing-cron-with-vi Here is a way to autosave a file at regular intervals: use cron !

The trick is to know that cron need percents to be escaped by a backslash in the command zone. For example, here is my crontab entry to create every 10 minutes a local backup of an important project file I currently work on:

*/10 * * * * kevin cp "/home/kevin/Desktop/Projects/Very Important Project/project.file" "/home/kevin/Desktop/Projects/Very Important Project/project.file-backup-`date +\%s`"

Quick and dirty, but may saves you precious time on unstable machines ! ;)

One thought on “Auto-saving a file at regular intervals

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>