Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rapidwebltd/backup-deletion
💾 Shell script to identify date named backups and remove them
https://github.com/rapidwebltd/backup-deletion
backup-deletion backup-files
Last synced: about 2 months ago
JSON representation
💾 Shell script to identify date named backups and remove them
- Host: GitHub
- URL: https://github.com/rapidwebltd/backup-deletion
- Owner: rapidwebltd
- License: mit
- Created: 2015-07-03T08:44:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-17T07:58:42.000Z (about 7 years ago)
- Last Synced: 2023-08-12T05:34:25.046Z (over 1 year ago)
- Topics: backup-deletion, backup-files
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Overview
This shell script is designed to identify any backup files present in a git repository, remove them from the repository (via `git rm`) and optionally commit and push the changes.
## Backup files
Backup files are identified based on their file names ending with an underscore `_` following by a string that represents a date.
The following are examples of file names which will be matched by this script.
* `terms_3rdOct2011.php`
* `test_8th_June_2011.php`
* `logout_5thOct2011.php`
* `test_260215.php`
* `style_25thJune2015.css`
* `style_31st_May_2013.css`
* `script_20th_May_2015.js`### File types
This script currently deals with `.php`, `.css`, `.js`, `.htm` and `.html` files.
## Download
To get the backup deletion script, `cd` to your project's directory and run the following `wget` command.
`wget -N https://raw.githubusercontent.com/rapidwebltd/backup-deletion/master/backup-deletion.sh`
Please note that you should download the script into a valid git repository. If you do not, it will refuse to run due to its destructive nature.
## Usage
Run the `./backup-deletion.sh` script from within your project's directory.
If you receive a `Permission denied` error, you need to make the script executable with `chmod +x backup-deletion.sh`.
## License
MIT