{"id":22045252,"url":"https://github.com/nigelhorne/syncfiles","last_synced_at":"2025-03-23T14:15:43.857Z","repository":{"id":148208696,"uuid":"145703661","full_name":"nigelhorne/syncfiles","owner":"nigelhorne","description":"Copy all files in a given directory to a date based hierecachy","archived":false,"fork":false,"pushed_at":"2025-02-07T16:53:58.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T17:32:59.597Z","etag":null,"topics":["archive","backup","perl","perl5"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nigelhorne.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}},"created_at":"2018-08-22T12:05:58.000Z","updated_at":"2025-02-07T16:54:02.000Z","dependencies_parsed_at":"2023-05-19T10:30:46.209Z","dependency_job_id":null,"html_url":"https://github.com/nigelhorne/syncfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2Fsyncfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2Fsyncfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2Fsyncfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2Fsyncfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nigelhorne","download_url":"https://codeload.github.com/nigelhorne/syncfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245111946,"owners_count":20562512,"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":["archive","backup","perl","perl5"],"created_at":"2024-11-30T13:12:25.149Z","updated_at":"2025-03-23T14:15:43.832Z","avatar_url":"https://github.com/nigelhorne.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# syncfiles\n\n## Overview\nThis script automates the backup of files from a specified directory into a date-organized hierarchy across multiple backup locations.\nIt ensures that timestamps (access and modification times) are preserved and that files are stored in read-only mode to prevent accidental modifications.\n\n## Features\n- Organizes files into `Year/Month/Day` structure\n- Supports multiple backup destinations\n- Preserves file timestamps\n- Ensures backup directories exist before copying\n- Implements logging for tracking operations\n- Skips existing files to prevent redundant copies\n\n## Requirements\n- Perl 5+\n- Required Perl modules:\n  - `File::Util`\n  - `File::stat`\n  - `File::Copy`\n  - `File::Spec`\n  - `DateTime`\n  - `File::Path`\n  - `Try::Tiny`\n  - `Log::Log4perl`\n\n## Installation\n1. Install Perl and required modules using CPAN:\n   ```sh\n   cpan install File::Util File::stat File::Copy File::Spec DateTime File::Path Try::Tiny Log::Log4perl\n   ```\n2. Copy the script to a desired location.\n3. Ensure the script has executable permissions:\n   ```sh\n   chmod +x syncfiles\n   ```\n\n## Usage\nRun the script with the directory to be backed up as an argument:\n```sh\n./syncfiles /path/to/source/directory\n```\n\nCopy all files in a given directory to a date-based hierachy in a number of places (@targets).\nThe dates of last access and modification are preserved.\n\nFor example \"syncfiles /tmp/foo\" will copy all of the files last modified on\n22/8/18 in /tmp/foo to /target1/2018/August/22, /target2/2018/August/22\nand so on.\n\nI use this to take lots of copies of photographs to many disks for backup,\nand have them sorted by date.\n\n## Logging\n- Logs are saved in `/tmp/syncfiles.log`.\n- Errors and successful operations are recorded for review.\n\n## Error Handling\n- If a file cannot be copied, an error message is logged instead of stopping execution.\n- If a directory cannot be created, the script logs the failure and continues.\n\n## License\n- Personal single user, single computer use: GPL2\n- For commercial, charity, educational, or government use, a license is required.\n\n## Contact\nFor licensing inquiries, contact: **Nigel Horne** (njh@bandsman.co.uk).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigelhorne%2Fsyncfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnigelhorne%2Fsyncfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigelhorne%2Fsyncfiles/lists"}