Schedule your backups
Ensure backups are done in a consistent and timely manner
You may use any scheduler to launch ElectricSheep.IO runs, such as Cron or Chronos. However, we think that the scheduling options for your backups should be:
- simple to read and configure: there's a 99% chance you'll want your backups to execute hourly or daily at a specific time
- come along your backup jobs: not in a crontab lost somewhere on your filesystem
ElectricSheep.IO thus provides you with an easy, built-in and human-readable way of scheduling your backups. To do so, specify a schedule for each of your job directly in your Sheepfile:
job "my-backup" do
schedule "daily"
...
end
Then start the program as a daemon:
electric_sheep start -d
That's it! Your backup project will execute every day at midnight, starting tonight.
Scheduling options
Hourly
To run your job every hour:
job "my-backup" do
schedule "hourly"
...
end
If you want your backup to start past a specific minute, use the past
option (defaults to 0
):
job "my-backup" do
schedule "hourly", past: 10
...
end
Daily
To run your job every day at midnight:
job "my-backup" do
schedule "daily"
...
end
If you want your backup to start at a specific time:
job "my-backup" do
schedule "daily", at: "03:17"
...
end
Weekly
To run your job every monday at midnight:
job "my-backup" do
schedule "weekly", on: "monday"
...
end
If you want your backup to start at a specific time:
job "my-backup" do
schedule "weekly", on: "monday", at: "04:00"
...
end
Monthly
To run your prjoboject every fifteenth of a month:
job "my-backup" do
schedule "monthly", every: 15
...
end
If you want your backup to start at a specific time:
job "my-backup" do
schedule "monthly", every: 15, at: "04:00"
...
end
Cron
To setup a complex schedule, you may use Cron expressions:
job "my-backup" do
schedule "cron", expression: "* 1 * * *"
...
end
Multiple schedules
You may need to schedule a backup job multiple times, for example every 6 hours. To do so, simply use the schedule
verb multiple times:
job "my-backup" do
schedule "daily", at: "00:00"
schedule "daily", at: "06:00"
schedule "daily", at: "12:00"
schedule "daily", at: "18:00"
...
end
Updated less than a minute ago