{"id":23991567,"url":"https://github.com/nikelborm/archive-compress-encrypt-and-back","last_synced_at":"2026-05-15T00:40:24.156Z","repository":{"id":198912105,"uuid":"701800443","full_name":"nikelborm/archive-compress-encrypt-and-back","owner":"nikelborm","description":"Simple script to archive (tar) compress (zstd) and encrypt(gpg) and do the opposite to folders","archived":false,"fork":false,"pushed_at":"2023-10-07T17:13:13.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T19:56:31.473Z","etag":null,"topics":["bash","gpg","tar","zstd"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikelborm.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":"2023-10-07T15:41:03.000Z","updated_at":"2024-12-31T12:26:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"09f4f7b7-c56d-46e2-9053-d2d9133f2f66","html_url":"https://github.com/nikelborm/archive-compress-encrypt-and-back","commit_stats":null,"previous_names":["nikelborm/bash-to-archived-compressed-encrypted-and-back","nikelborm/archive-compress-encrypt-and-back"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikelborm%2Farchive-compress-encrypt-and-back","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikelborm%2Farchive-compress-encrypt-and-back/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikelborm%2Farchive-compress-encrypt-and-back/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikelborm%2Farchive-compress-encrypt-and-back/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikelborm","download_url":"https://codeload.github.com/nikelborm/archive-compress-encrypt-and-back/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240609249,"owners_count":19828561,"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":["bash","gpg","tar","zstd"],"created_at":"2025-01-07T19:56:02.719Z","updated_at":"2026-05-15T00:40:24.144Z","avatar_url":"https://github.com/nikelborm.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# main.sh\n\n\u003e [!IMPORTANT]\n\u003e The script was rewritten to typescript and now lives in my [nikelborm/effect-garden](https://github.com/nikelborm/effect-garden): [archive-compress-encrypt-and-back](https://github.com/nikelborm/effect-garden/tree/main/packages/archive-compress-encrypt-and-back). Bash version is not maintained.\n\n`main.sh` is a Bash script that provides two functions for creating and extracting encrypted compressed archives. The script uses the `tar`, `zstd`, and `gpg` utilities to create and extract archives.\n\n## Usage\n\n```plaintext\nUsage: main.sh do_tar_zstd_gpg source_dir dest_file\n       main.sh undo_tar_zstd_gpg source_file dest_dir\n\n  do_tar_zstd_gpg: Create a tar archive, compress with zstd, and encrypt with gpg\n  undo_tar_zstd_gpg: Decrypt, decompress, and extract files from an encrypted compressed archive\n\n  source_dir: The source directory to be archived\n  source_file: The source archive file to be extracted\n  dest_file: The destination archive file to be created\n  dest_dir: The destination directory for the extracted files\n\nExamples:\n  Put all files and dirs which are inside ~/.local/share/TelegramDesktop directory\n  into encrypted compressed archive ~/tg.tar.zst.gpg:\n    ./main.sh do_tar_zstd_gpg ~/.local/share/TelegramDesktop ~/tg.tar.zst.gpg\n\n  Put all files and dirs which are inside encrypted compressed archive ~/tg.tar.zst.gpg\n  into directory ~/.local/share/TelegramDesktop:\n    rm -rf ~/.local/share/TelegramDesktop; ./main.sh undo_tar_zstd_gpg ~/tg.tar.zst.gpg ~/.local/share/TelegramDesktop\n\nNotes:\n  Env\n    The GPG recipient email or key ID can be set using the GPG_RECIPIENT environment variable. For example:\n    GPG_RECIPIENT=\"recipient_email@example.com\" main.sh do_tar_zstd_gpg /path/to/source_dir /path/to/dest_file\n\n  Archiving\n    Script does not check if the destination file exists, so it is recommended\n    that you manually delete the old archive before creating a new one.\n\n    Script does not add any extensions, so it is recommended\n    that you manually add .tar.zst.gpg to the archive file\n\n  Extracting\n    Script does not handle conflicts when extracting files, so it is recommended\n    that you manually delete the content of destination directory before extracting.\n```\n\n## Functions\n\n### `do_tar_zstd_gpg`\n\nThe `do_tar_zstd_gpg` function creates an encrypted compressed archive of a directory. The function takes two arguments:\n\n- `source_dir`: The source directory to be archived.\n- `dest_file`: The destination file for the archive.\n\n### `undo_tar_zstd_gpg`\n\nThe `undo_tar_zstd_gpg` function extracts an encrypted compressed archive to a directory. The function takes two arguments:\n\n- `source_file`: The source archive file to be extracted.\n- `dest_dir`: The destination directory for the extracted files.\n\n## Environment Variables\n\n### `GPG_RECIPIENT`\n\nThe `GPG_RECIPIENT` environment variable sets the recipient email or key ID for the `gpg` encryption. The default value is `\"recipient_email@example.com\"`. To set a different recipient, export the `GPG_RECIPIENT` variable before invoking the script.\n\n## License\n\nThis script is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikelborm%2Farchive-compress-encrypt-and-back","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikelborm%2Farchive-compress-encrypt-and-back","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikelborm%2Farchive-compress-encrypt-and-back/lists"}