{"id":24767056,"url":"https://github.com/xpyctiks/backup-download","last_synced_at":"2026-05-09T15:33:08.537Z","repository":{"id":209646855,"uuid":"724097823","full_name":"Xpyctiks/backup-download","owner":"Xpyctiks","description":"Scripts for creation of local backups and download them from remote servers to one central server.Allows notifications to Telegram and write logs to MySQL.","archived":false,"fork":false,"pushed_at":"2023-12-21T15:00:33.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T18:27:33.223Z","etag":null,"topics":["backup","backup-script","backupcreate","bash","bash-script","mysql","telegram","telegram-bot"],"latest_commit_sha":null,"homepage":"https://xpyct.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xpyctiks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-11-27T11:49:15.000Z","updated_at":"2023-11-27T11:52:07.000Z","dependencies_parsed_at":"2024-01-16T09:04:43.421Z","dependency_job_id":"20bb5547-7c6b-4cb6-a3f4-3ff676a94eea","html_url":"https://github.com/Xpyctiks/backup-download","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"5414a46874954a5c98fea07b6010f565c7f67605"},"previous_names":["xpyctiks/backup-download"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Xpyctiks/backup-download","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xpyctiks%2Fbackup-download","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xpyctiks%2Fbackup-download/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xpyctiks%2Fbackup-download/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xpyctiks%2Fbackup-download/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xpyctiks","download_url":"https://codeload.github.com/Xpyctiks/backup-download/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xpyctiks%2Fbackup-download/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32824348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","backup-script","backupcreate","bash","bash-script","mysql","telegram","telegram-bot"],"created_at":"2025-01-29T00:42:59.925Z","updated_at":"2026-05-09T15:33:08.519Z","avatar_url":"https://github.com/Xpyctiks.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Backup-download - script to download backups from remote servers with logging to MySQL DB and Zabbix monitor template.\n\nMain functions of this script:\n-download backups from remote servers.It can be done via SCP or RSYNC.\n-send alerts and errors to LOG-file and Telegram when ran from CRON env.\n-write download logs to MySQL database.Then the status of jobs done can be determinied by another script.\n\nThis system means that you have somewhere on remote server some folder where backups are stored.Logically and physically they are divided into two types:\nDaily backups and Weekly backups.Also, there must be such two folder inside you main folder.\nFor example: \n-main folder is \"/home/backup\"\n-there are two folders inside: \"/home/backup/daily\" and \"/home/backup/weekly\".\nAlso, this script for download is related to the other one - backup.sh which lays nearby. You can use that script on the remote side to properly create backups, \nand backup-download.sh script to download them.\nAll backups are begin created in subfolders according to its type - daily backup is in daily folder.Weekyly - in weekly folder.\nFormat of the name of the backup's folder is a date - for ex. 23.07.2023. Backup-download script looking into the today's date named folder\nwhile trying to download backups.\nExample:\nfor download today's backup when today is 23.07.2023, we need to have the next structure(in case of SCP):\n1)Today is 23.07.2023\n2)Remote side has:\n/home/backup/daily/23.07.2023/\u003cfiles here\u003e\n3)This script is launched with \"daily\" parameter.So it is heading to remote server to /home/backup/daily/23.07.2023/ and download all from there to local\nfolder from $backupsFolder value + domain name of server + type (Daily/Weekly) + current date.\nEx.: /media/storage/server.com/daily/23.07.2023\nIn case of Rsync, the script takes $remRsyncFolder value and syncing it to the local $backupsFolder/$domain/Weekly folder.\n\nThis script determines the environment it's launched in. If it is shell env. - the script shows up all alerts and work logs to console.\nIf it is launched in CRON env. - it creates LOG-file and place all messages in it.\n-If Telegram settings are set in .local file - error messages are being sent to Telegram,not only to LOG.\n-If MySQL settings are set - the results of jobs done are being written to the DB.\n\nAt the first launch of backup-download.sh script, it will create backup-download.local file.It consists important settings for general work.All settings in there\nhave comments with explanation what do they do.\nAt the second launch - the script will generate backup-download.list file.It consists settings of remote servers. It has next format:\n\n\u003chostname\u003e \u003cdnsname\u003e \u003ctype\u003e \u003cdailyType\u003e \u003cweeklyType\u003e \u003cremScpDir\u003e \u003cscpUser\u003e \u003cremRsyncDir\u003e \u003crsyncUser\u003e\n\u003chostname\u003e    - Name of a host which is used as folder name on backup server and in log messages.\n\u003cdnsname\u003e     - DNS or IP address of the host. Just for connections.\n\u003ctype\u003e        - What we can do with that host - download \"all\" (daily and weekly), or only \"daily\" or \"weekly\" backups.\n\u003cdailyType\u003e   - How to do daily downloads: via \"scp\" or \"rsync\".\n\u003cweeklyType\u003e  - How to do weekly downloads: via \"scp\" or \"rsync\".\n\u003cremScpDir\u003e   - Remote directory with backups. For example: /home/backup. Inside os this dir. must be folders \"daily\" and \"weekly\" with backups.\n\u003cscpUser\u003e     - Username for SCP connection.\n\u003cremRsyncDir\u003e - Remote directory to be fully synced with a local one.Can be ignored if not use Rsync.\n\u003crsyncUser\u003e   - Username for Rsync connection. If not set, scpUser's value will be used.Can be ignored if not use Rsync.\nExample:\ncloudserver1.infra clo01phx0.domain.com all scp scp home/backup bckp \ncloudserver2.infra clo01phx1.domain.com all scp rsync home/backup bckp /var/www root\n\n#Backup.sh - script to create local backups of DB and folders.\n\nThe script uses shared settings.local file to get all necessary settings, and his own file with settings of points need to be backed up.\nThe file named backup.list. It has simple format:\n\u003ctype\u003e: \u003cvalue\u003e where:\n\u003ctype\u003e should be: \"db:\" or \"backup:\"\n\u003cvalue\u003e - a path to folder for backup, or name of DB to backup. Path must be without / at the end.\nexample:\ndb: siteDatabase\nbackup: /var/www\n\nYou can create personal dumps of MySQL databases via \"db:\" option, or an archived copy of some folder with subfolders via \"site:\" option.\nImportant moment - \"site:\" backups are created only when \"weekly\" type is selected.In \"daily\" there are only \"db:\" backups being made.\nAll files are stored in $backupLocalFolder in subfolder according the type of launch - daily or weekly.\n\nIn settings.local there are few personal options for backup.sh:\nlocalBackupsFolder - local folder where backups will be stored.Inside this folder will be \"daily\" and \"weekly\" folders\nuid - user to make an owner of the files\ngid - group to make an owner of the files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpyctiks%2Fbackup-download","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxpyctiks%2Fbackup-download","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpyctiks%2Fbackup-download/lists"}