{"id":15081628,"url":"https://github.com/maxvalue/ansible-role-borgbackup_ftp","last_synced_at":"2026-02-03T18:07:36.847Z","repository":{"id":237414318,"uuid":"608121228","full_name":"MaxValue/ansible-role-borgbackup_ftp","owner":"MaxValue","description":"Perform borgbackup backups of FTP directories","archived":false,"fork":false,"pushed_at":"2023-05-08T23:13:54.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T19:17:28.284Z","etag":null,"topics":["ansible-roles","borg","borg-backup","borgbackup","ftp","ftp-protocol"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/ui/standalone/roles/MaxValue/borgbackup_ftp/","language":null,"has_issues":false,"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/MaxValue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-03-01T11:13:51.000Z","updated_at":"2023-10-11T12:53:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"a59a638b-8510-4a7c-ab4b-eb36bc8d5fd8","html_url":"https://github.com/MaxValue/ansible-role-borgbackup_ftp","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"f473459bdec9ac4aebeaf754dbd1a4d078dfe651"},"previous_names":["maxvalue/ansible-role-borgbackup_ftp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MaxValue/ansible-role-borgbackup_ftp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxValue%2Fansible-role-borgbackup_ftp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxValue%2Fansible-role-borgbackup_ftp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxValue%2Fansible-role-borgbackup_ftp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxValue%2Fansible-role-borgbackup_ftp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaxValue","download_url":"https://codeload.github.com/MaxValue/ansible-role-borgbackup_ftp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaxValue%2Fansible-role-borgbackup_ftp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263046484,"owners_count":23405194,"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":["ansible-roles","borg","borg-backup","borgbackup","ftp","ftp-protocol"],"created_at":"2024-09-25T06:00:37.665Z","updated_at":"2026-02-03T18:07:36.784Z","avatar_url":"https://github.com/MaxValue.png","language":null,"funding_links":["https://www.buymeacoffee.com/publicbetamax","https://de.liberapay.com/maxvalue/","https://ko-fi.com/publicbetamax"],"categories":[],"sub_categories":[],"readme":"# Ansible Role: Borgbackup FTP\n\nAn Ansible Role that backups a directory of an FTP server to a borgbackup repository.\n\nThis role only runs on the ansible controller.\n\n[TOC]\n\n## Requirements\n\n* [lftp](https://lftp.yar.ru/)\n* optional: [borg](https://borgbackup.readthedocs.io/en/stable/installation.html)\n\n## Role Variables\n\nAvailable variables are listed below, along with default values (see `defaults/main.yml`):\n\n### Main Variables\n\n    ftp_vars: \"set ssl:check-hostname false \u0026\u0026 set ftp:list-options -a \u0026\u0026\"\n\nThe optional variable `ftp_vars` sets additional variables (settings) for lftp. Make sure to separate multiple options with the `\u0026\u0026` phrase and end the string with `\u0026\u0026` as well.\n\n    ftp_host\n\nThe mandatory variable `ftp_host` sets the address of the FTP server.\n\n    ftp_user\n\nThe optional variable `ftp_user` sets the name of the FTP user. If none is defined, the role tries to download the directory anonymously.\n\n    ftp_password\n\nThe optional variable `ftp_password` sets the password of the FTP user.\n\n    ftp_mirror_opts: \"--delete --parallel=2\"\n\nThe optional variable `ftp_mirror_opts` sets additional parameters for the `mirror` command of lftp.\n\n    ftp_src\n\nThe mandatory variable `ftp_src` defines the FTP path which should be downloaded.\n\n    ftp_dest\n\nThe optional variable `ftp_dest` defines the path where the contents of the FTP directory will be stored.\n\n    ftp_speedup: true\n\nThe optional variable `ftp_speedup` determines whether the FTP download speed should be optimized.\nIf true, this adds the option `--only-newer` to `ftp_mirror_opts` (if not customized)\nand tries to checkout the latest borg archive from the given repo before downloading the directory on top of it.\n\n    ftp_download_cleanup: true\n\nThe optional variable `ftp_download_cleanup` determines whether the downloaded directory should be deleted when everything has been completed.\n\n    borgbackup_perform: true\n\nThe optional variable `borgbackup_perform` determines whether a borg backup of the downloaded directory will be performed or not.\n\n    borgbackup_borgpath: \"borg\"\n\nThe optional variable `borgbackup_borgpath` sets the path to the borg executable.\n\n    borgbackup_sshcommand\n\nThe optional variable `borgbackup_sshcommand` sets the command used to connect via SSH to the repository. This can be used to supply additional options to the SSH command.\n\n    borgbackup_repo\n\nThe mandatory variable `borgbackup_repo` sets the URL to the borg repository.\n\n    borgbackup_passphrase\n\nThe mandatory variable `borgbackup_passphrase` sets the passphrase to interact with the borg repository.\n\n    borgbackup_archivenameformat: \"{{ ftp_host }}-{{ _borgbackup_timeformat }}\"\n\nThe optional variable `borgbackup_archivenameformat` sets the name format used for naming the borg archives.\n\n    borgbackup_archivenameprefix\n\nThe optional variable `borgbackup_archivenameprefix` defines a prefix in front of borg archive names.\nThis feature is untested.\n\n    borgbackupftp_nolog: true\n\nThe optional variable `borgbackupftp_nolog` determines whether secrets should be logged or not.\n\n### Background variables\n\nThese variables define specific defaults which can be overriden, if wanted.\n\n    _borgbackup_timeformat: \"%Y-%m-%dT%H:%M:%S\"\n\nThe optional variable `_borgbackup_timeformat` time format used by the borg `--timestamp` parameter (a [strptime](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior) string). This probably never needs to change.\n\n    borgbackup_timeout: [null, 600]\n\nThe optional variable `[null, 600]` defines timeouts for the `borg create` command via a 2 item array.\nThe first item defines the timeout when no archive already exists (usually the first archive takes very long)\nand the second item defines the timeout when at least one archive already exists.\n\n    borgbackup_timeout_prepare: null\n\nThe optional variable `borgbackup_timeout_prepare` defines the timeout when checking out the last borg archive.\nOf course, this is only relevant when `borgbackup_perform` and `ftp_speedup` are `true`.\n\n### Internal variables\n\nThese are variables internally created by the role. Please do not use them in your code.\n\n    _result_tmpdir_dest\n\nThe internal variable `_result_tmpdir_dest` stores the path to the generated tmp directory for storing the downloaded FTP contents.\n\n    _result_ftp_download\n\nThe internal variable `_result_ftp_download` stores the task result of the lftp download task.\nThis is needed in order to determine if files were actually downloaded which influences the `changed` state of the task.\n\n    _result_borglist_raw\n\nThe internal variable `_result_borglist_raw` contains the string response from the `borg list` command which is used to determine the latest archive in the borg repository.\n\n    _result_borglist\n\nThe internal variable `_result_borglist` contains the JSON response from the `borg list` command which is used to determine the latest archive in the borg repository.\n\n    _borgbackup_timeout\n\nThe internal variable `_borgbackup_timeout` contains the actual timeout value which is derived from `_result_borglist` and `borgbackup_timeout`.\n\n    _nullval\n\nThe internal varialbe `_nullval` stores the value `null` because Ansible would complain if used directly.\n\n## Dependencies\n\n* The community.general collection: `ansible-galaxy collection install --force community.general`\n\n## Example Playbooks\n\n### Normal usage\n\n    ---\n    # This downloads an FTP directory and creates a borg archive of it\n    - hosts: localhost\n      roles:\n        - role:\n            name: maxvalue.borgbackup_ftp\n          vars:\n            ftp_host: MY.AWESOME.FTP.HOST.EXAMPLE.COM\n            ftp_user: THATSME\n            ftp_password: HEREISMYPRETTYFTPPASSWORD\n            ftp_src: /my/remote/ftp/dir\n            borgbackup_repo: borguser@borghost:22/path/to/borg/repo\n            borgbackup_sshcommand: ssh -i /home/myname/.ssh/borgbackup_ed25519\n            borgbackup_passphrase: HEREISMYBORGPASSPHRASE\n    ...\n\n### Only download an FTP directory\n\n    ---\n    # This downloads an FTP directory\n    - hosts: localhost\n      roles:\n        - role:\n            name: maxvalue.borgbackup_ftp\n          vars:\n            ftp_host: MY.AWESOME.FTP.HOST.EXAMPLE.COM\n            ftp_user: THATSME\n            ftp_dest: /the/path/where/to/download/to\n            borgbackup_perform: false\n    ...\n\n## License\n\n[MIT](LICENSE.txt)\n\n## Sponsors\n\nYou can support the development of this role and other similar roles by donating to one of the accounts below.\n\n* [bymeacoffee](https://www.buymeacoffee.com/publicbetamax)\n* [liberapay](https://de.liberapay.com/maxvalue/)\n* [ko-fi](https://ko-fi.com/publicbetamax)\n* [Patreon](patreon.com/publicbetamax)\n\n## Author Information\n\nThis role was created in 2022 by Max Fuxjäger:\n* Mastodon: @maxvalue@chaos.social\n* Matrix: @ypsilon:matrix.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxvalue%2Fansible-role-borgbackup_ftp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxvalue%2Fansible-role-borgbackup_ftp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxvalue%2Fansible-role-borgbackup_ftp/lists"}