{"id":13647901,"url":"https://github.com/frdmn/tar-multibackup","last_synced_at":"2025-04-22T06:32:17.122Z","repository":{"id":28387091,"uuid":"31901271","full_name":"frdmn/tar-multibackup","owner":"frdmn","description":":floppy_disk: Bash script to backup and cycle tar archives","archived":false,"fork":false,"pushed_at":"2017-02-26T13:28:32.000Z","size":13,"stargazers_count":47,"open_issues_count":1,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-09T22:36:14.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frdmn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-09T13:58:19.000Z","updated_at":"2024-02-23T13:04:31.000Z","dependencies_parsed_at":"2022-09-03T14:40:17.818Z","dependency_job_id":null,"html_url":"https://github.com/frdmn/tar-multibackup","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/frdmn%2Ftar-multibackup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frdmn%2Ftar-multibackup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frdmn%2Ftar-multibackup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frdmn%2Ftar-multibackup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frdmn","download_url":"https://codeload.github.com/frdmn/tar-multibackup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250183347,"owners_count":21388701,"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":"2024-08-02T01:03:49.669Z","updated_at":"2025-04-22T06:32:16.893Z","avatar_url":"https://github.com/frdmn.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"tar-multibackup\n===============\n\n\nBash script to backup multiple folders and to clean up old backups based on a retention time. Features configurable post/pre-commands, tar excludes as well as backup retentions.\n\n### Installation\n\n    cd /usr/local/src\n    git clone https://github.com/frdmn/tar-multibackup.git\n    ln -sf /usr/local/src/tar-multibackup/multibackup /usr/local/bin/multibackup\n    cp /usr/local/src/tar-multibackup/multibackup.conf ~/.multibackup.conf\n\n### Configuration and usage\n\n* `timestamp` = Format of the timestamp, used in the backup target filename\n* `backup_destination` = Directory which is used to store the archives/backups\n* `folders_to_backup` = Array of folders to backup\n* `backup_retention` = Retention time how long we should keep the backups\n* `pre_commands` = Array of commands that are executed before the backup starts (stop specific service)\n* `post_commands` = Array of commands that are executed after the backup finished (start specific service)\n\n### Environment configurations\n\n* `DEBUG` = if set to \"true\", `set -x` will be set\n* `CONFIG` = if you want to use a different configuration file than the \n\nExample: \n\n    CONFIG=/tmp/testbackup.conf DEBUG=true multibackup\n\n#### Example configuration \n\nIn the example below you can find a `multibackup` configuration file to backup a productional [LiveConfig](http://www.liveconfig.com/) instance.\n\n`vi ~/.multibackup.conf`\n\n    # Timestamp format, used in the backup target filename\n    timestamp=$(date +%Y%m%d)\n\n    # Destination where you want to store your backups\n    backup_destination=\"/var/backups\"\n\n    # Folders to backup\n    folders_to_backup=(\n      \"/etc\"\n      \"/var/mail\"\n      \"/var/www\"\n      \"/var/lib/mysql\"\n      \"/var/spool/cron\"\n      \"/var/lib/liveconfig\"\n    )\n\n    # Files and folders that are excluded in the tar command\n    tar_excludes=(\n      \"nginx-php-fcgi.sock\"\n    )\n\n    # How long to you want to keep your backups (in days)\n    backup_retention=\"+7\"\n\n    # Commands that are executed before the backup started\n    # (We have to make sure the liveconfig process is not running)\n    # (otherwise the databases changes while we try to save it)\n    pre_commands=(\n      \"service liveconfig stop\"\n    )\n\n    # Commands that are executed after the backup is completed\n    # (To restart the liveconfig process again, once the backup is completed)\n    post_commands=(\n      \"service liveconfig start\"\n    )\n\n#### Cronjob setup\n\nTo make sure the backup is executed automatically and recurring, we're going to add a simple cronjob:\n\n`vi /etc/cron.d/backup-liveconfig`\n\n    #\n    # cronjob to backup LiveConfig, daily at 5:00 am\n    #\n\n    0 5 * * *        root       /usr/local/bin/multibackup \u0026\u003e/dev/null\n\n### Version\n1.2.0\n\n### Lincense\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrdmn%2Ftar-multibackup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrdmn%2Ftar-multibackup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrdmn%2Ftar-multibackup/lists"}