{"id":22882470,"url":"https://github.com/var7600/rm-secure","last_synced_at":"2025-03-31T16:38:13.093Z","repository":{"id":266756684,"uuid":"899267364","full_name":"Var7600/rm-secure","owner":"Var7600","description":"yet Another alternative for the Evil /bin/rm command in Linux that provides options for backup, retention, and restoration of deleted file(s) or directory(ies).","archived":false,"fork":false,"pushed_at":"2024-12-06T15:23:16.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T21:45:30.756Z","etag":null,"topics":["bash","cli","linux","recovery-tool","shell","trash"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Var7600.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":"2024-12-05T23:30:14.000Z","updated_at":"2024-12-06T15:23:20.000Z","dependencies_parsed_at":"2024-12-06T00:27:18.596Z","dependency_job_id":"5feec54e-8634-437c-b466-ab927aabff44","html_url":"https://github.com/Var7600/rm-secure","commit_stats":null,"previous_names":["var7600/rm-secure"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Var7600%2Frm-secure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Var7600%2Frm-secure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Var7600%2Frm-secure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Var7600%2Frm-secure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Var7600","download_url":"https://codeload.github.com/Var7600/rm-secure/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246499290,"owners_count":20787475,"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","cli","linux","recovery-tool","shell","trash"],"created_at":"2024-12-13T18:17:49.369Z","updated_at":"2025-03-31T16:38:13.073Z","avatar_url":"https://github.com/Var7600.png","language":"Shell","readme":"# rm-secure \n\n![logo](https://github.com/user-attachments/assets/1e9c424b-1a76-487a-a131-1fe07c521fdf)\n\n                                                               \n![Screenshot 2024-12-05 183535](https://github.com/user-attachments/assets/71e9f9aa-240d-4590-82b7-95edf5da68c5)\n\n                                                                   \n\nyet Another alternative for the `Evil /bin/rm` command in Linux that provides\noptions for backup, retention, and restoration of deleted file(s) or\ndirectory/ies.\n\n[![CI - ShellCheck and Bats](https://github.com/Var7600/rm-secure/actions/workflows/ci.yml/badge.svg)](https://github.com/Var7600/rm-secure/actions/workflows/ci.yml)\n\n## Installation\n\n1.Clone the Repository\n\n```bash\ngit clone https://github.com/Var7600/rm-secure.git\ncd rm-secure/\n```\n\n## Install Dependencies\n\n2.Ensure you have the following installed:\n\n- `shellcheck` for linting (optional for users but required for contributing)\n- `Bats` for testing (optional for users but required for contributors)\n\nFor Debian/Ubuntu:\n```bash\n sudo apt install shellcheck bats\n```\nFor macOS (via Homebrew):\n```bash\nbrew install shellcheck bats\n```\n\n3.Make the Script Executable\n```bash\nchmod +x rm-secure.sh\n```\n\n4.add script path to `.bashrc`\n```bash\nsource path/to/file/rm-secure.sh\n```\n\n5.Add rm-secure.sh Path to `.bashrc`\n```bash\nexport PATH=\"$PATH:path/to/file/\"\n```\n- or rather than replacing built in `rm` you can use `rm-secure.sh`\n```bash\nsudo cp rm-secure.sh /usr/local/bin/rm-secure\n```\nNow, you can use rm-secure as a command instead of rm.\n\n## Usages\n```bash\n\nrm_secure: A safer alternative to GNU rm\nUsage: rm [OPTIONS] FILE...\nOptions:\n  -d \u003cdays\u003e      Set retention period in days (default: 60 days)\n  -e, --empty    Empty the trash folder\n  -l, --list     List files in the trash folder\n  -s, --restore  Restore files or directory from trash\n  -r/-R, --delete delete a directory \n  -v, --verbose  Verbose output\n  --help         Show this help message\n```\n\n- delete file\n\n```bash\n \u003e$ rm test.cpp\nrenamed 'test.cpp' -\u003e '/home/var7600-unix/rm_saved/2024_12_03_22h08m_test.cpp'\nsaved for 60 days\n```\n\n- list deleted file(s)\n\n```bash\n \u003e$ rm -l\ntotal 0\n-rw-r--r-- 1 var7600-unix var7600-unix 337 Dec  3 22:09 2024_12_03_22h08m_test.cpp\n```\n\n- restore file(s)\n\n```bash\n \u003e$ rm -s test.cpp\nrenamed '/home/var7600-unix/rm_saved/2024_12_03_22h08m_test.cpp' -\u003e './2024_12_03_22h08m_test.cpp'\n```\n\n- empty trash definitively\n\n```bash\n \u003e$ rm -e\n```\n\n- deleting a directory use `-r` or `-R` option \n\n```bash\n \u003e$ rm -r Scripts\ndeleting Scripts/ (Saved in ~/home/var7600/rm_saved/)\nsaved for 60\n```\n\n- restore directory\n\n```bash\n \u003e$ rm -s Scripts\n```\n\n## Notes\n- Ensure that the `sauvegarde_rm` directory is accessible and writable (default is `~/rm-saved/`).\n- This script overrides `rm` behavior and moves files to a temporary location instead of deleting them permanently.\n\n## TO DO\n- [ ] make a `-d` or `--days` option to specify the number of days to save the deleted file.\n\n## Contributions\nall Contributions bug/reports/issues/pull request are welcome.\nClone the repository and set up dependencies.\n\n   1.write your features or fix or ...\n\n   2.Run ShellCheck to lint the script:\n    ```bash\n        shellcheck rm-secure.sh\n    ```\n    \n3. add yours tests and Run Bats to test\n    ```\n        bats tests/\n    ```\n\n## License\n    MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvar7600%2Frm-secure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvar7600%2Frm-secure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvar7600%2Frm-secure/lists"}