{"id":18555642,"url":"https://github.com/n2ref/remote_backup","last_synced_at":"2025-05-15T13:10:14.398Z","repository":{"id":72438959,"uuid":"437333917","full_name":"n2ref/remote_backup","owner":"n2ref","description":"Backing up files and databases on remote servers","archived":false,"fork":false,"pushed_at":"2024-02-11T17:13:04.000Z","size":2425,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T11:28:17.473Z","etag":null,"topics":["backup","config","console","mysql","php","remote","sftp","ssh"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/n2ref.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,"dei":null}},"created_at":"2021-12-11T16:34:17.000Z","updated_at":"2023-04-09T14:40:59.000Z","dependencies_parsed_at":"2024-02-11T18:24:42.075Z","dependency_job_id":"ef9fbb98-e4d4-44e0-b92b-b971bd4114e4","html_url":"https://github.com/n2ref/remote_backup","commit_stats":null,"previous_names":["n2ref/remote_backup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2ref%2Fremote_backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2ref%2Fremote_backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2ref%2Fremote_backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n2ref%2Fremote_backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n2ref","download_url":"https://codeload.github.com/n2ref/remote_backup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346626,"owners_count":22055809,"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":["backup","config","console","mysql","php","remote","sftp","ssh"],"created_at":"2024-11-06T21:27:26.965Z","updated_at":"2025-05-15T13:10:14.381Z","avatar_url":"https://github.com/n2ref.png","language":"PHP","readme":"# Remote backup\nBacking up files and databases on remote servers\n\n```\nBackup remote or local files over SSH\nUsage: php remote_backup.phar [OPTIONS]\nRequired arguments:\n        -h      --host      Host name in config file\n        -c      --config    Path to config file. Default conf.ini\nOptional arguments:\n        --help              Help info\n        --verbose           Verbose info\nExamples of usage:\nphp remote_backup.phar --host orange --config conf.ini --verbose\nphp remote_backup.phar --host orange\nphp remote_backup.phar --host all\n```\n\n### Config\n\nCreate your own set of files on your servers, which you need to periodically save in the configuration file.\n\n```ini\n[general]\n;mail.email  =\n; smtp, mail\n;mail.method  = smtp\n;mail.smtp.host   =\n;mail.smtp.port   =\n;mail.smtp.auth   = true\n; SSL, TLS\n;mail.smtp.secure = SSL\n;mail.smtp.user   =\n;mail.smtp.pass   =\n\n[local]\ndump.dir   = /mnt/backup/local/\ndump.name  = %Y-%m-%d_%H\ndump.count = 7\n\nlocal.files.1 = /file/path/1\nlocal.files.2 = /file/path/2\nlocal.files.3 = /file/path/3\nlocal.files.4 = /var/www\n\n[server1]\n; list active days, comma separator. Default - All\n; mon, tue, wed, thu, fri, sat, sun\nschedule.week_days = sat\n\ndump.dir   = /mnt/backup/server1/\ndump.name  = %Y-%m-%d_%H\ndump.count = 7\n\nlocal.mysql.on   = true\nlocal.mysql.host = 192.168.1.2\nlocal.mysql.port = 3306\nlocal.mysql.user = root\nlocal.mysql.pass = \nlocal.mysql.mysqldump_path    = mysqldump\nlocal.mysql.mysqldump_options = --quick --max_allowed_packet=1G --compress\nlocal.mysql.gzip_path      = gzip\n; list backup databases, comma separator. Default - All\nlocal.mysql.databases      =\n\n\nremote.ssh.host = 192.168.1.5\nremote.ssh.port = 22\nremote.ssh.user = root\n; none, pass, private_key, private_key-pass, agent\nremote.ssh.auth_method  = pass\nremote.ssh.pass         =\n; file path: RCA\nremote.ssh.private_key  =\nremote.ssh.agent_socket =\n\nremote.mysql.on   = true\nremote.mysql.host = localhost\nremote.mysql.port = 3306\nremote.mysql.user = root\nremote.mysql.pass =\nremote.mysql.mysqldump_path    = mysqldump\nremote.mysql.mysqldump_options = --quick --max_allowed_packet=1G --compress\nremote.mysql.gzip_path         = gzip\nremote.mysql.tmp_dir           = /tmp\n; list backup databases, comma separator. Default - All\nremote.mysql.databases         =\n\nremote.files.1 = /etc/crontab\nremote.files.2 = /etc/nginx/sites-available\nremote.files.3 = /var/www\n```\n\n\nTo start, you can run the script manually or through cron.\n\n`0 4 * * * root /opt/remote_backup.phar -h server1 -c /opt/conf.ini`\n\n\n\n### Example of work\n\n```\n$ php8.0 /opt/remote_backup.phar -h server1 -c /opt/conf.ini --verbose\n[16:31:47] BACKUP HOST: server1\n[16:31:48] CREATE MYSQL DUMP\n[16:31:49] DOWNLOAD MYSQL DUMP: /tmp/backup_2021-12-11_16.sql.gz ---\u003e /mnt/backup/server1/2021-12-11_16/mysql_dump.sql.gz\n[16:31:49] DELETE REMOTE MYSQL DUMP: /tmp/backup_2021-12-11_16.sql.gz\n[16:31:49] COPY REMOTE: /etc/crontab ---\u003e /mnt/backup/server1/2021-12-11_16/remote_files/etc/crontab\n[16:31:49] COPY REMOTE: /etc/nginx/sites-available ---\u003e /mnt/backup/server1/2021-12-11_16/remote_files/etc/nginx/sites-available\n[16:31:49] COPY REMOTE: /var/www ---\u003e /mnt/backup/server1/2021-12-11_16/remote_files/var/www\n[16:33:47] CREATE ZIP\nDone.\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn2ref%2Fremote_backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn2ref%2Fremote_backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn2ref%2Fremote_backup/lists"}