{"id":26464844,"url":"https://github.com/xacnio/backupper","last_synced_at":"2025-08-03T04:42:55.603Z","repository":{"id":182599208,"uuid":"668738998","full_name":"xacnio/backupper","owner":"xacnio","description":"Backup tool on between remote sources and destinations (SFTP/FTP/Telegram)","archived":false,"fork":false,"pushed_at":"2023-09-22T19:45:22.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T04:42:53.831Z","etag":null,"topics":["ftp","golang","sftp","telegram"],"latest_commit_sha":null,"homepage":"","language":"Go","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/xacnio.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-20T13:37:00.000Z","updated_at":"2024-09-06T17:03:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"3aa91fbd-7aef-423b-aa15-8f22e53b4603","html_url":"https://github.com/xacnio/backupper","commit_stats":null,"previous_names":["xacnio/backupper"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/xacnio/backupper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xacnio%2Fbackupper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xacnio%2Fbackupper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xacnio%2Fbackupper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xacnio%2Fbackupper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xacnio","download_url":"https://codeload.github.com/xacnio/backupper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xacnio%2Fbackupper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268495924,"owners_count":24259401,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ftp","golang","sftp","telegram"],"created_at":"2025-03-19T08:55:13.500Z","updated_at":"2025-08-03T04:42:55.541Z","avatar_url":"https://github.com/xacnio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"### (IN DEVELOPMENT)\n\n# Backupper\nThe tool is for backuping file from FTP/SFTP source and save it another FTP/SFTP backup destination.\n\n# Features\n- Schedule backuping with CRON expression in config file\n- Download files from FTP/SFTP sources\n- Executing commands on source server (SFTP only)\n- Upload files to FTP/SFTP destinations\n- Upload files to Telegram with Bot API (max 50 MB files)\n- Limit the file count in target folder (if limit is reached, oldest backups will be deleted)\n- Limit the total file size in target folder (if limit is reached, oldest backups will be deleted)\n- Limit the target folder by duration (oldest backups than date will be deleted)\n\n# Config\nMain config file is `config.json` in the root folder of the project.\nAlso you can use [`config.example.json`](config.example.json) as a template.\n\n### Main Structure\n```json\n{\n  \"timezone\": \"Europe/Istanbul\",\n  \"dateFormat\": \"2006-01-02__15-04-05\",\n  \"backups\": []\n}\n```\n\n| Key        | Description                                                                                                   | Type   |\n|------------|---------------------------------------------------------------------------------------------------------------|--------|\n| timezone   | [TZ identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)                                 | string |\n| dateFormat | the format of the date to be added to the file name ([Golang time format](https://go.dev/src/time/format.go)) | string |\n| logLevel   | Log level (debug, info, warn, error, dpanic, panic, fatal)                                                    | string |\n| backups    | Backup schedules                                                                                              | array  |\n\n## Backup Schedule Structure\n```json\n{\n  \"name\": \"backup-title\",\n  \"cronExpr\": \"*/60 * * * * *\",\n  \"callbackUrl\": \"http://example.com/callback\",\n  \"deleteLocal\": true,\n  \"source\": {\n    \"type\": \"sftp\",\n    \"info\": {\n      \"host\": \"127.0.0.1\",\n      \"port\": 22,\n      \"user\": \"root\",\n      \"pass\": \"\",\n      \"privateKeyFile\": \"~/.ssh/custom_id_rsa\",\n      \"privateKeyPass\": \"\",\n      \"variables\": {\n        \"foo\": \"bar\",\n        \"bar\": 123,\n        \"baz\": true\n      },\n      \"beforeCommands\": [\n        \"echo $foo \u003e /tmp/backupper/$BACKUP_ID/foo.txt\",\n        \"echo $bar \u003e /tmp/backupper/$BACKUP_ID/bar.txt\",\n        \"echo $baz \u003e /tmp/backupper/$BACKUP_ID/baz.txt\",\n        \"cd /opt/foo/bar\",\n        \"zip -r /tmp/backupper/$BACKUP_ID/foo_backup.zip .\"\n      ],\n      \"downloads\": [\n        \"foo_backup.zip\",\n        \"foo.txt\",\n        \"bar.txt\",\n        \"baz.txt\"\n      ],\n      \"afterCommands\": [\n        \"rm -rf /tmp/backupper/$BACKUP_ID/\"\n      ]\n    }\n  },\n  \"destination\": {\n    \"type\": \"ftp\",\n    \"deleteAfterUpload\": true,\n    \"info\": {\n      \"host\": \"backup-ftp.example.com\",\n      \"port\": 21,\n      \"user\": \"root\",\n      \"pass\": \"p4ssw0rd\",\n      \"target\": \"/up/backups/foo/\",\n      \"limitByCount\": 3,\n      \"LimitBySize\": 1073741824,\n      \"limitByDate\": \"2 DAYS\"\n    }\n  }\n}\n```\n\n| Key         | Description                                                                       | Type   |\n|-------------|-----------------------------------------------------------------------------------|--------|\n| name        | Name of the backup schedule                                                       | string |\n| cronExpr    | [CRON expression](https://en.wikipedia.org/wiki/Cron) (also supports cronSeconds) | string |\n| callbackUrl | Callback URL to be called after backup process is completed                       | string |\n| deleteLocal | Delete local files after upload process is completed                              | bool   |\n| source      | Source server information                                                         | object |\n| destination | Destination server information                                                    | object |\n\n## Source \n| Key        | Description                                                                         | Type   |\n|------------|-------------------------------------------------------------------------------------|--------|\n| type       | Source server type (ftp/sftp)                                                       | string |\n| info       | Source server information                                                           | object |\n\n### Source Info (FTP)\n| Key       | Description                                                          | Type   |\n|-----------|----------------------------------------------------------------------|--------|\n| host      | FTP server host                                                      | string |\n| port      | FTP server port                                                      | int    |\n| user      | FTP server username                                                  | string |\n| pass      | FTP server password                                                  | string |\n| downloads | Files to be downloaded from FTP server (only files, not directories) | array  |\n\n### Source Info (SFTP)\n| Key            | Description                                                           | Type   |\n|----------------|-----------------------------------------------------------------------|--------|\n| host           | SFPT server host                                                      | string |\n| port           | SFTP server port                                                      | int    |\n| user           | SFTP server username                                                  | string |\n| pass           | SFTP server password                                                  | string |\n| privateKeyFile | Private key file path                                                 | string |\n| passphrase     | Private key passphrase                                                | string |\n| variables      | Custom variables to be used in SSH commands                           | object |\n| beforeCommands | SSH Commands to be executed before download process                   | array  |\n| downloads      | Files to be downloaded from SFTP server (only files, not directories) | array  |\n| afterCommands  | SSH Commands to be executed after download process                    | array  |\n\n#### SFTP - SSH Command Variables\n| Variable     | Description                                                                   | Type   |\n|--------------|-------------------------------------------------------------------------------|--------|\n| $BACKUP_ID   | Unique ID of the backup process (generated by the tool) (Nano unix timestamp) | string |\n| $BACKUP_NAME | Name of the backup schedule                                                   | string |\n\n## Destination\n| Key               | Description                                     | Type   |\n|-------------------|-------------------------------------------------|--------|\n| type              | Destination server type (ftp/sftp/telegram_bot) | string |\n| deleteAfterUpload | Delete files after upload process is completed  | bool   |\n| info              | Destination server information                  | object |\n\n### Destination Info (Telegram with Bot API) (max 50 MB files)\n| Key          | Description                                                  | Type   |\n|--------------|--------------------------------------------------------------|--------|\n| token        | Telegram bot token from [@BotFather](https://t.me/BotFather) | string |\n| chatID       | Telegram chat ID (channel/group) or public username          | string |\n\n### Destination Info (FTP)\n| Key          | Description                                           | Type   |\n|--------------|-------------------------------------------------------|--------|\n| host         | FTP server host                                       | string |\n| port         | FTP server port                                       | int    |\n| user         | FTP server username                                   | string |\n| pass         | FTP server password                                   | string |\n| target       | Target folder on FTP server                           | string |\n| limitByCount | Limit the file count in target folder                 | int    |\n| limitBySize  | Limit the total file size in target folder (bytes)    | int    |\n| limitByDate  | Limit the target folder by duration (duration format) | string |\n\n### Destination Info (SFTP)\n| Key            | Description                                           | Type   |\n|----------------|-------------------------------------------------------|--------|\n| host           | SFTP server host                                      | string |\n| port           | SFTP server port                                      | int    |\n| user           | SFTP server username                                  | string |\n| pass           | SFTP server password                                  | string |\n| privateKeyFile | Private key file path                                 | string |\n| passphrase     | Private key passphrase                                | string |\n| target         | Target folder on SFTP server                          | string |\n| limitByCount   | Limit the file count in target folder                 | int    |\n| limitBySize    | Limit the total file size in target folder (bytes)    | int    |\n| limitByDate    | Limit the target folder by duration (duration format) | string |\n\n#### limitByDate - Duration Format\n| Format                | Date Range                    |\n|-----------------------|-------------------------------|\n| 5 MINUTES             | All files before 5 minutes    |\n| 1 HOUR                | All files before 1 hour       |\n| 2 DAYS                | All files before 2 days       |\n| 3 WEEKS               | All files before 3 weeks      |\n| 4 MONTHS              | All files before 4 months     |\n| 5 YEARS               | All files before 5 years      |\n\nMultiple durations can be used together. (e.g. 1 HOUR 30 MINUTES)\n\n## Callback Post Data\n```json\n{\n  \"backup_date\": \"2023-07-20T15:27:50+03:00\",\n  \"backup_destination\": \"sftp\",\n  \"backup_destination_result\": {\n    \"totalUploadedFiles\": 1,\n    \"totalUploadedSize\": 5820073\n  },\n  \"backup_duration\": \"19.7989235s\",\n  \"backup_id\": \"1689856070674044500\",\n  \"backup_name\": \"test-backup\",\n  \"backup_source\": \"sftp\",\n  \"backup_ts\": 1689856070\n}\n```\n\n| Key                       | Description                                                                   | Type   |\n|---------------------------|-------------------------------------------------------------------------------|--------|\n| backup_date               | Backup date  (RFC3339)                                                        | string |\n| backup_destination        | Destination server type (ftp/sftp)                                            | string |\n| backup_destination_result | Destination server upload result                                              | object |\n| backup_duration           | Backup duration (time.Duration string)                                        | string |\n| backup_id                 | Unique ID of the backup process (generated by the tool) (Nano unix timestamp) | int    |\n| backup_name               | Name of the backup schedule                                                   | string |\n| backup_source             | Source server type (ftp/sftp)                                                 | string |\n| backup_ts                 | Backup timestamp (Unix seconds)                                               | int    |\n\n# Used Modules\n- [go-co-op/gocron](https://pkg.go.dev/github.com/go-co-op/gocron)\n- [jlaffaye/ftp](https://pkg.go.dev/github.com/jlaffaye/ftp)\n- [uber/zap](https://pkg.go.dev/go.uber.org/zap)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxacnio%2Fbackupper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxacnio%2Fbackupper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxacnio%2Fbackupper/lists"}