{"id":24838789,"url":"https://github.com/liolb/backuproutine","last_synced_at":"2025-03-26T04:26:03.079Z","repository":{"id":273027627,"uuid":"900275559","full_name":"liolb/BackupRoutine","owner":"liolb","description":"a python script that helps automating file backups","archived":false,"fork":false,"pushed_at":"2024-12-08T11:09:09.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T06:25:06.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/liolb.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,"publiccode":null,"codemeta":null}},"created_at":"2024-12-08T11:07:32.000Z","updated_at":"2024-12-09T11:51:38.000Z","dependencies_parsed_at":"2025-01-18T06:19:34.584Z","dependency_job_id":"dc233fc1-f6a4-498b-adc0-9730fdfb78da","html_url":"https://github.com/liolb/BackupRoutine","commit_stats":null,"previous_names":["liolb/backuproutine"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liolb%2FBackupRoutine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liolb%2FBackupRoutine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liolb%2FBackupRoutine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liolb%2FBackupRoutine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liolb","download_url":"https://codeload.github.com/liolb/BackupRoutine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245587338,"owners_count":20639926,"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-31T06:21:56.268Z","updated_at":"2025-03-26T04:26:03.050Z","avatar_url":"https://github.com/liolb.png","language":"Python","readme":"# BackupRoutine \n\nto help automate backups.\n\nThis script can be used to create (regularly) `*.zip`-compressed backups of pre-defined file collections (wildcards are supported).\n\nA configuration file allows to declare \"Backup Profiles\" and \"Backup Destinations\". A **Backup Profile** defines a set of files. These files will be backed up as a single compressed (`*.zip`) file by the BackupRoutine and stored at the locations given by the **Backup Destinations**. \n\n## Getting started\n\nAfter downloading the code\n### Setup the Configuration File \n\nFirst copy or rename `sample_config.json` to get `config.json`.\nThen, the sections `backup_profile` and `backup_destination` need to be customised to your needs, see sections [[#Backup Profiles]] and [[#Backup Destinations]].\n\n### Running the script\n\n```bash\npython3 ./backup.py\n```\n\nBackupRoutine runs all active profiles and destinations. The file collections of all active profiles will be separately packed, compressed and backed up to all active destinations. Backups are created as zip files in the form `{backup_profile.id}/archive{backup_datetime}.zip`\nAfter each backup process destinations older backups are deleted as defined in [[#Clean-Up Mechanism]].\nFor Errors see: [[#Error alerts]].\n\n## Command Line Arguments\n\nBackupRoutine supports the following command line arguments, examples see below.\n\n| Argument | Argument Effect                                                               |\n| -------- | ----------------------------------------------------------------------------- |\n| `-p`     | specify a Backup Profile                                                      |\n| `-d`     | specify Backup Destination(s) (one or several)                                |\n| `-t`     | perform a dry run, i.e. run the process without actually creating any backups |\n\nThe following example will run only `backup_1` and create backups on all active destinations:\n\n```bash \npython3 ./backup.py -p backup_1\n```\n\nThe following example will run all active profiles and create backups in `my_backup_vault_1`and `my_backup_vault_2`:\n\n```bash\npython3 ./backup.py -d my_backup_vault_1 my_backup_vault_2\n```\n\nUsing the command line argument  `-t` you can run the backup process without creating backups:\n\n```bash\npython3 ./backup.py -t\n```\n\nError logs will be displayed in the terminal if anything in the configuration file is wrong. \nThe number of files that will be backed up is displayed.\n\n\n## Backup Profiles\n---\nA Backup Profile defines the files of which a backup should be created. \nYou can either put a list of all files into `sources`or select files using wildcards and `ignore` patterns.\n\n```json\n\"backup_profiles\": [\n    {\n        \"id\": \"my_backup\",                   // This is the unique name of the backup profile\n        \n        \"active\": true,                      // Each profile can be set active or inactive\n        \n        \"source\": [                          // A collection of files is defined by a list of search patterns such as\n            \"*/sample/backup_this_dir/\",\n            \"*/backup_all/*/test_folders/\",\n            \"*/backup_all_textfiles/*.txt\"\n        ],\n        \"ignore\": [                          // Additionally you can exlude files or directories, as for example\n            \".*\",                            // ignore all files starting with a dot, ...\n            \"*/not-this-dir/\",\n            \"temp*\"   \n        ]\n    } \n    // ...you can add as many backup profiles as you wish   \n```\n\n## Backup Destinations\n\nA Backup Destination defines where to store the backups and how long to keep them.\n\n```json\n\"backup_destinations\": [\n    {\n        \"id\": \"my_backup_vault\",          // This is the unique name of the backup destination\n        \n        \"active\": true,                   // Each destination can be set active or inactive\n        \n        \"days_to_keep\": 28,               // For each destination you can define how long the backup should be stored\n                                          // If backups should never be deleted: set `days_to_keep = -1\n        \"directory\": \"./destination/\"     // directory where the backup should be stored\n    }\n    // ...you can add as many backup destinations as you wish  \n```\n\n### Clean-Up Mechanism\n\nSubsequently, after each backup run, a clean-up mechanism will be performed in all declared destinations. For each destination you can define how long the backup should be stored by setting the property `days_to_keep`. All backups older than this date will be deleted. If backups should never be deleted: set `days_to_keep = -1`. \n\n\n## Error alerts\n\nThe script has no real alert system implemented. In case of an error the user will be \"notified\" by the error log being opened in the standard editor and displayed to the user.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliolb%2Fbackuproutine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliolb%2Fbackuproutine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliolb%2Fbackuproutine/lists"}