Skip to content

Instantly share code, notes, and snippets.

@vincentlkl
Created November 6, 2017 14:52
Show Gist options
  • Save vincentlkl/0b67f82d7b20915521d75532b6eecafa to your computer and use it in GitHub Desktop.
Save vincentlkl/0b67f82d7b20915521d75532b6eecafa to your computer and use it in GitHub Desktop.
Automate Backup in VPS
1. SSH to server
2. $ sudo gem install backup
3. $ backup generate:model --trigger=db_backup --databases='postgresql' --storages='dropbox'
4. Edit the /Backup folder
5. Test it manually
$ backup perform -t db_backup
6. Install whenever at /Backup folder
$ sudo gem install whenever
7. $ mkdir config
8. $ wheneverize
9. At Backup/config/schedule.rb edit the scheduler
every 12.hours do
command "/home/deploy/.rbenv/shims/backup perform -t db_backup >> /home/deploy/Backup/config/cron.log 2>&1"
end
10. $ whenever
11. $ whenever --update-crontab
12. $ whenever -i
13. ! Take note that the scheduler should not be too short it should be more than a hour else it will not work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment