{"id":16623063,"url":"https://github.com/tobischulz/rsync-backup-server","last_synced_at":"2025-10-29T22:31:36.821Z","repository":{"id":56647972,"uuid":"305121095","full_name":"tobischulz/rsync-backup-server","owner":"tobischulz","description":"A Laravel rsync backup server package","archived":true,"fork":false,"pushed_at":"2022-05-03T12:28:46.000Z","size":39,"stargazers_count":7,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T19:09:37.539Z","etag":null,"topics":["backups","laravel","php","rsync","rsync-backup","rsync-backup-script"],"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/tobischulz.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}},"created_at":"2020-10-18T14:31:35.000Z","updated_at":"2025-01-30T08:42:47.000Z","dependencies_parsed_at":"2022-08-15T22:31:41.849Z","dependency_job_id":null,"html_url":"https://github.com/tobischulz/rsync-backup-server","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobischulz%2Frsync-backup-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobischulz%2Frsync-backup-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobischulz%2Frsync-backup-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobischulz%2Frsync-backup-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobischulz","download_url":"https://codeload.github.com/tobischulz/rsync-backup-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238909394,"owners_count":19550839,"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":["backups","laravel","php","rsync","rsync-backup","rsync-backup-script"],"created_at":"2024-10-12T03:22:19.896Z","updated_at":"2025-10-29T22:31:31.458Z","avatar_url":"https://github.com/tobischulz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rsync Backup Server\n\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n\nThis package let you handle all of your off-site backups by your own laravel project on your own hosted server. Add your source to the database and dispatch a new backup job through the artisan command. Laravel queue system will handle all steps to backup your databases or files.\n\n## Installation\n\nPull this package in using composer:\n\n```bash\ncomposer require tobischulz/rsync-backup-server\n```\n\nPublish the package files:\n\n```bash\nphp artisan vendor:publish --provider=\"TobiSchulz\\RsyncBackupServer\\RsyncBackupServerProvider\"\n```\n\nAdd a backup destination storage disk `config/filesystems.php`, where to store all the backup files. Driver **has** to be **`local`**.\n\n```php\n'disks' =\u003e [\n\n    //...\n\n    'my_backup_disk' =\u003e [\n        'driver' =\u003e 'local',  // must be local\n        'root' =\u003e '/Volumes/Share/rsync-backups',  // your own path\n    ],\n\n    //...\n]\n```\n\nAdd backup dispatch schedule command to `app\\Console\\Kernel.php`:\n\n```php\n/**\n * Define the application's command schedule.\n *\n * @param  \\Illuminate\\Console\\Scheduling\\Schedule  $schedule\n * @return void\n */\nprotected function schedule(Schedule $schedule)\n{\n    $schedule-\u003ecommand('backups:dispatch')-\u003ehourly();\n}\n```\n\nSet your queue system in your .env file:\n\n```env\nQUEUE_CONNECTION=database  // redis for horizon\n```\n\nThis package should work with every laravel queue system. Currently i tested it only with database. Make sure your migrations has been run for database queue driver.\n\nYou can publish the queue migrations with this artisan command: `php artisan queue:table`\n\n## Usage\n\nCreating your first source:\n\n```php\n$source = SourceServer::create([\n    'name' =\u003e 'mySource',   // source name\n    'host' =\u003e '123.123.123.123',    // ip of the source server\n    'ssh_user' =\u003e 'forge',  // ssh user on the source server\n    'ssh_private_key_path' =\u003e '~/.ssh/id_rsa',  // path to the ssh private key from backup server\n    'ssh_port' =\u003e 22,   // ssh port, default 22\n    'backup_hour' =\u003e 5, // this sets the schedule for 5am UTC\n    'source_path' =\u003e '~/backups/*', // folder on source to backup\n    'destination_disk' =\u003e 'my_backup_disk',  // disk we created in /config/filesystems.php\n    'type' =\u003e 'rsync' // set 'rsync' or 'backup'\n]);\n\n```\n\n### backup_hour\n\nSet your hour when the backup should be scheduled every day. The schedule command in `app\\Console\\Kernel.php` will read all source servers from database that backup_hour is equal to the current time and dispatch the new backup job.\n\n### ssh_private_key_path\n\nYou will need to add your ssh public key from your backup server to every source server you want to connect to and make backups from. In this configuration you will need to set the private key of the backup server, that will be used to connect to your source server. With this database path of your private key you will be able to use different keys for each source server.\n\n### type\n\nThere are two types of backups in this package. The default `backup` will create a new folder every time a backup runs. This will increase the disk usage on every backup but this should be handeld by the `cleanup` command later.\n\nThe second type is `rsync`. This type will sync the source folder with the destination folder.\n\n\n### Manually dispatch Backup\n\nYou can manually dispatch a new backup job by using the artisan command `php artisan backup:run mySource` where *mySource* is the source name in your database.\n\n### Schedule Backups\n\nBackup jobs will be scheduled based on your `backup_hour` configuration on your source servers. This is handeld by the added artisan schedule command `php artisan backups:dispatch` in `app\\Console\\Kernel.php`.\n\n## Security\n\nIf you discover any security-related issues, please email tobias@byte.software instead of using the issue tracker.\n\n## Credits\n\nThis package is heavly inspired by the upcoming package [spatie/laravel-backup-server](https://spatie.be/docs/laravel-backup-server/v1/introduction) made by [Spatie](https://github.com/spatie/).\n\n- [Tobias Schulz](https://github.com/tobischulz)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobischulz%2Frsync-backup-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobischulz%2Frsync-backup-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobischulz%2Frsync-backup-server/lists"}