This repository contains a Python script that allows you to automatically take backups of a specified folder. The script uses the shutil
library to create a ZIP archive of the source folder and stores it in the destination folder.
- Take a backup of a folder manually or automatically at specified intervals.
- Zip the backup files to save disk space.
- Customizable backup intervals.
To use the script, follow the steps below:
-
Clone this repository to your local machine or download the
backup.py
file. -
Make sure you have Python installed on your system.
-
Modify the
src_folder
anddest_folder
variables in the script to specify the source folder you want to back up and the destination folder where you want to store the backups. -
Run the script with the following options:
--backup now
: Takes an immediate backup of the source folder.--backup (interval)
: Takes automatic backups at specified intervals. Replace(interval)
with the number of hours between each backup.
Example: To take backups every 2 hours, run:
python backup.py --backup 2
-
If you run the script without any options or use the
-h
or--help
option, it will display the help message with available options.
- Python 3.x
colorama
library (install it usingpip install colorama
)
This script is provided as-is, without any warranty. Use it at your own risk. Before running the script, make sure to test it on non-production environments.
Feel free to open an issue or submit a pull request if you find any bugs or want to improve the script.
This project is licensed under the MIT License.