Page MenuHomePhabricator

Regularly backup program dashboard data
Closed, ResolvedPublic3 Estimated Story Points

Description

The Programs dashboard doesn't currently back up the programs data. We should write a backup service.

Write a script on tool labs that does a mysqldump backup of their database once a week and stores it in a backup directory in their project account on tool labs. The script should also delete any backups that are older than 3 months. Automate it with a cron job.

Event Timeline

The Programs dashboard doesn't currently back up the data. We should write a backup service.

Can you elaborate on this a little? It's not clear to me what we mean by backup data here.

kaldari renamed this task from Backup program dashboard data to Regularly backup program dashboard data.Jul 14 2016, 5:00 PM
kaldari updated the task description. (Show Details)
kaldari updated the task description. (Show Details)

I'm not sure if this is the best way to do it, but I just made a simple bash script, see https://phabricator.wikimedia.org/P3875

I assume this should not go in the git repository.

The crontab entry would look like:

0 0 * * 0 jlocal sh ~/backup.sh

Note the script requires GNU Coreutils which does not ship with OS X, should you want to test the script locally.

It's your call, but I recommend adding a copy of it to the repo and documenting how to install it and extra steps (if any) necessary to get it be able to access tools-db, if setting it up on a fresh server.

If you do put it into git, the server_config directory is the place for that kind of thing.

It's your call, but I recommend adding a copy of it to the repo and documenting how to install it and extra steps (if any) necessary to get it be able to access tools-db, if setting it up on a fresh server.

Sounds good! I also confused myself into thinking this was on Tool Labs, so I don't think what I have above will work. That being said, it might also be good to use AutoMySQLBackup for consistency :) Thanks for access to the Labs project, I will test out the script on staging.

I decided again to go with a simple bash script, which Ragesoss said was fine. The file is at https://github.com/MusikAnimal/WikiEduDashboard/blob/backup-outreach-data2/server_config/outreach_mysql_backup.sh and tested to be working on the staging server. The crontab should look like:

0 0 * * 0 sudo sh /var/www/dashboard/current/server_config/outreach_mysql_backup.sh

Please review before I deploy it to production Outreach Dashboard.

Code has been deployed, configured on production, and is working properly :D