{"id":24653109,"url":"https://github.com/jsardev/vps-backup","last_synced_at":"2025-03-20T23:28:57.173Z","repository":{"id":205061420,"uuid":"482209507","full_name":"jsardev/vps-backup","owner":"jsardev","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-16T09:21:29.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-25T20:13:43.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jsardev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-04-16T09:21:12.000Z","updated_at":"2023-11-02T08:33:22.000Z","dependencies_parsed_at":"2023-11-17T14:10:53.698Z","dependency_job_id":null,"html_url":"https://github.com/jsardev/vps-backup","commit_stats":null,"previous_names":["sarneeh/vps-backup","jsardev/vps-backup"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsardev%2Fvps-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsardev%2Fvps-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsardev%2Fvps-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsardev%2Fvps-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsardev","download_url":"https://codeload.github.com/jsardev/vps-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244709196,"owners_count":20497026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-01-25T20:13:49.580Z","updated_at":"2025-03-20T23:28:57.149Z","avatar_url":"https://github.com/jsardev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Requirements\r\n\r\n* [Drive](https://github.com/odeke-em/drive) - Google Drive push/pull cli\r\n* [7-Zip](http://www.7-zip.org/download.html) - Compression app\r\n\r\n# How to install\r\n\r\n* Clone repository on your server\r\n* Set executable permissions to backup script `chmod +x /path/to/repo/create_backup.sh`\r\n* Create a directory in `$HOME/backup`\r\n* Init `drive` in the backup directory\r\n* Add `HOME` and `PATH` variables in your server's crontab\r\n    * Make sure that `drive` binary is in the `PATH`\r\n* Add an entry in your server's crontab, i.e. `00 04 * * * bash /path/to/repo/create_backup.sh`\r\n    * Make sure you add all required parameters\r\n    * Make sure that you run script with `bash /path/to/script.sh` syntax, not `sh /path/to/script.sh`\r\n* Enjoy your backups!\r\n\r\n## Example crontab configuration\r\n\r\n    PATH=/usr/local/go/bin:/root/go:/root/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\r\n    HOME=/root\r\n\r\n    # m h  dom mon dow   command\r\n    00 06 * * * bash /tools/tools-vps-backup/create_backup.sh -n serverName -d /var/www -d /etc/hosts -m true -mp mySQLPassword\r\n    \r\n# Usage\r\n\r\nYou can run the script with following parameters:\r\n\r\n* `-n/--name` - server name, i.e. `-n vps1` (required)\r\n* `-d/--directories` - backup directories, i.e. `-d /etc/hosts -d /var/www` (required)\r\n    * if you want to pass multiple directories, pass each directory in separate `-d` parameter\r\n    * directory files are taken recursively\r\n* `-m/--mysql` - mysql backup switch\r\n* `-mp/--mysql-password` - mysql root password\r\n\r\n# Notes\r\n\r\nRemember to create a `.driveignore` file with `tmp` entry in your Google Drive directory!\r\n\r\n# Troubleshooting\r\n\r\n## It produces weird output and doesn't work in general\r\nProbably the script has been commited from a Windows machine with wrong encoding. Try to convert the script to be Unix compatible.\r\n\r\n* `sudo apt-get install dos2unix`\r\n* `dos2unix /path/to/repo/create_backup.sh`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsardev%2Fvps-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsardev%2Fvps-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsardev%2Fvps-backup/lists"}