Difference between revisions of "Automating your backups with cron"

From docwiki
Jump to: navigation, search
Line 6: Line 6:
 
== User and System Crontab ==
 
== User and System Crontab ==
   
cron has a text based configuration file that contains the commands that should be run and when they should be run.
+
cron has a text based configuration file that contains the commands that should be run and when they should be run. You can view this with
  +
  +
<pre>
  +
crontab -l
  +
</pre>
  +
  +
And edit it with:
  +
  +
<pre>
  +
crontab -e
  +
</pre>
  +
  +
which opens up your default editor.
  +
   
 
== Example Crontab ==
 
== Example Crontab ==

Revision as of 12:35, 29 October 2020

Motivation

If you only do your backup when you hear about a case of someone loosing data then you will not have a recent backup when you need it. So you should automate the backup process. If you want to run a certain command at a regular interval then you can use the unix cron tool.

User and System Crontab

cron has a text based configuration file that contains the commands that should be run and when they should be run. You can view this with

crontab -l

And edit it with:

crontab -e

which opens up your default editor.


Example Crontab