{"id":23036781,"url":"https://github.com/wildzarek/42cleaner","last_synced_at":"2025-08-14T17:32:27.314Z","repository":{"id":261105134,"uuid":"883119663","full_name":"WildZarek/42cleaner","owner":"WildZarek","description":"Python script to clean temp files and older versions from Snap for 42 students.","archived":false,"fork":false,"pushed_at":"2024-11-22T14:01:29.000Z","size":521,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-22T14:36:55.656Z","etag":null,"topics":["42school","automation","cache-cleaner","linux","python3","ubuntu","utils"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WildZarek.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-11-04T12:12:12.000Z","updated_at":"2024-11-22T13:51:03.000Z","dependencies_parsed_at":"2024-11-27T06:15:57.627Z","dependency_job_id":null,"html_url":"https://github.com/WildZarek/42cleaner","commit_stats":null,"previous_names":["wildzarek/42cleaner"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildZarek%2F42cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildZarek%2F42cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildZarek%2F42cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildZarek%2F42cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WildZarek","download_url":"https://codeload.github.com/WildZarek/42cleaner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229851105,"owners_count":18134156,"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":["42school","automation","cache-cleaner","linux","python3","ubuntu","utils"],"created_at":"2024-12-15T17:27:27.264Z","updated_at":"2025-08-14T17:32:27.300Z","avatar_url":"https://github.com/WildZarek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 42cleaner\n\n42cleaner is a Python script designed to clean temp/cache files and unnecessary older versions from Snap.\n\nIt helps to free up disk space and maintain system performance.\n\nIt can be scheduled for automatic background execution (using cron).\n\nMade for 42 students. Tested on **42 Málaga** school running **Linux/Ubuntu**. NOT for macOS.\n\n\u003cimg src=\"assets/run.png\" alt=\"Script running\" align=\"center\" /\u003e\n\n# Why?\n\nDue to the limit of 5 GB size for 'home' directory and looking to provide a solution\nfor the problem with the Snap package manager which is not removing properly\nold versions (revisions), this tool has born to solve that problem.\n\n# Trash files\n\nThis tool removes the following files:\n\n- Empties recycle bin (Trash).\n- All .zcompdump files (A cache file used by compinit).\n- All Cache files in our home (~/.cache)\n- Cache files from vscode (~/.config/Code/Cache and ~/.config/Code/CachedData)\n- Cache files from firefox (~/snap/firefox/common/.cache)\n- Cache files from slack (~/snap/slack/common/.cache)\n- All temp files created by Francinette. (~/francinette/temp)\n- Older versions (revisions) from installed Snap packages.\n\n# Alias for easy usage\n\nThe script can set up an alias automatically in your shell's config file.\n\nThis will make extremely easy to remember the shell command to run it next time.\n\n- **Verbose Mode**: Some prompts are only visible if this flag are used.\n\n\u003e [!WARNING]\n\u003e If you do not see any prompt, maybe an error has occurs (like config file does not exist or alias already existing in file)\n\u003e\n\u003e Is not an error, just use the flag --verbose to avoid this behavior.\n\n# Scheduled tasks and modes\n\nThe script allows you to choose from different time intervals so that the task runs automatically in the background.\n\n- **Silent Mode**: This mode is intended to run the script in the background, without any prompts.\n- **Verbose Mode**: This mode is intended to run the script without the flag **--silent** and for printing additional information.\n\n# How to use\n\n```\nusage: 42cleaner.py [-h] [-s]\n\nCleaner script for 42 students.\n\noptions:\n  -h, --help    show this help message and exit\n  -s, --silent  runs the script in silent mode without any prompts\n  -v, --verbose runs the script in verbose mode with additional prompts\n```\n\nClone this repository by using the following command:\n\n```bash\ngit clone https://github.com/WildZarek/42cleaner.git\n```\n\nThen, move to the new downloaded folder:\n\n```bash\ncd 42cleaner\n```\n\nFinally, run the script (sudo permissions not needed):\n\n```bash\npython3 42cleaner.py\n```\n\n\u003e [!TIP]\n\u003e If the alias was configured previously, just run it writting '42cl' in the terminal.\n\n\u003e [!IMPORTANT]\n\u003e If the used space in your 'home' is under 60%, the tool doesn't do any operation.\n\u003e\n\u003e Otherwise, the tool performs the needed operations to free space.\n\n\u003e [!WARNING]\n\u003e The cron task (if configured) will not synchronize on other computers on campus,\n\u003e this is due to 42's own configuration, so it is not a problem with the script.\n\u003e\n\u003e Therefore, it's necessary to configure the cron task every time you want to use this functionality.\n\n# Acknowledgments\n\nThanks to [@4ndymcfly](https://github.com/4ndymcfly) for his contributions.\n\n# License\n\nThis work is published under the terms of **[42 Unlicense](https://github.com/gcamerli/42unlicense)**.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildzarek%2F42cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwildzarek%2F42cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildzarek%2F42cleaner/lists"}