Automatic backup to MEGA cloud with crontab

Backing up stuff to the cloud is all the rage, and I wanted to give it a try. Since I don’t really want to spend any money on it, I decided to go with the best free provider I could find. I haven’t done too much research, but MEGA’s 50 free GB seems to be the best offer around. They also have a simple CLI tool called megatools (manual). Since I couldn’t find megatools in the official debian repo, I decided to use it from docker....

Backup docker postgresql data with crontab

# m h dom mon dow command # SQL Backup (daily) 15 1 * * * docker exec -t iixnotes_database_1 pg_dumpall -U postgres | gzip > /media/stor/backup/iix-notes.daily.psql.gz # SQL Backup (weekly) 15 1 * * 0 docker exec -t iixnotes_database_1 pg_dumpall -U postgres | gzip > /media/stor/backup/iix-notes.weekly.psql.gz # SQL Backup (monthly) 15 1 1 * * docker exec -t iixnotes_database_1 pg_dumpall -U postgres | gzip > /media/stor/backup/iix-notes.monthly.psql.gz