Sign inSign up

yurividal/sqldumpsshcron

By yurividal

•Updated almost 6 years ago

Executes backups of SQL databases and local files, and saves backups offsite with scp

Image
0

1.5K

yurividal/sqldumpsshcron repository overview

This container uses a script located in etc/periodic/<frequency> to do:

  • generate mysqldump of the selected database and files/folders
  • tar the dump and the files and save it to /backups
  • clean backups older than X days
  • copy the new backup to a remote server using scp
  • clean the remote server from backups older than X days
⁠HOW TO USE

Pull the image yurividal/sqldumpsshcron:latest

⁠MANDATORY VARIABLES:

None

⁠OPTIONAL VARIABLES:

VARIABLE

VARIABLEDESCRIPTIONEXAMPLE
FREQUENCYHow often backup should run. Default: daily. Accepted:15min,hourly,daily,weekly,monthlyweekly
BACKUP_THESEThe Files and Folders that should be included in the bkp/path/to/folder,path/to/file.extention
BACKUPS_TO_KEEPOptional number of backups to keep in backup folder. If not set, will keep all backups forever.15
MYSQL_DATABASEName of database that will be backed up as sqldumpmy_table
MYSQL_USERMANDATORY if MYSQL_DATABASE is setroot
MYSQL_PASSWORDMANDATORY if MYSQL_DATABASE is setMyPassword
MYSQL_HOSTMANDATORY if MYSQL_DATABASE is setmariadb_container
REMOTE_IPThe IP of the Remobe Backup Server192.168.0.147
REMOTE_DIRMANDATORY if REMOTE_IP is set. The directory in the remote backup server. Full path./mnt/UKDataStore/UKFreeNAS/Backups/phpipam
SSH_USERNAMEMANDATORY if REMOTE_IP is setuser
SSH_PASSMANDATORY if REMOTE_IP is set.myShhPass

⁠Predefined Times:

The container has the following crontab by default:

# do daily/weekly/monthly maintenance
# min	hour	day	month	weekday	command
*/15	*	*	*	*	run-parts /etc/periodic/15min
0	*	*	*	*	run-parts /etc/periodic/hourly
0	2	*	*	*	run-parts /etc/periodic/daily
0	3	*	*	6	run-parts /etc/periodic/weekly
0	5	1	*	*	run-parts /etc/periodic/monthly

Tag summary

Content type

Image

Digest

Size

12.9 MB

Last updated

almost 6 years ago

docker pull yurividal/sqldumpsshcron