Created
January 21, 2017 10:09
-
-
Save ryochin/7be534d61c26b43d694349e4e9e44642 to your computer and use it in GitHub Desktop.
whenever schedule file for rsnapshot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source_dir = '/app/myproject' | |
rsnapshot_dir = '/mnt/rsnapshot' | |
set :output, "#{rsnapshot_dir}/cron.log" | |
set :job_template, 'root :job' | |
nice = '/bin/nice -15' | |
every 1.hour, at: '00:10' do | |
command "#{nice} /usr/bin/rsnapshot sync && #{nice} /usr/bin/rsnapshot hourly" | |
end | |
every 1.day, at: '03:15' do | |
command "#{nice} /usr/bin/rsnapshot daily" | |
end | |
every :sunday, at: '03:20' do | |
command "#{nice} /usr/bin/rsnapshot weekly" | |
end | |
every '25 3 1 * *' do | |
command "#{nice} /usr/bin/rsnapshot monthly" | |
end | |
every '30 3 1 1 *' do | |
command "#{nice} /usr/bin/rsnapshot yearly" | |
end | |
# dummy latest file | |
every 5.minutes do | |
command "/bin/touch #{source_dir}/latest" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment