This project is a Python script that archives specified locations on your computer and sends them to a web hosting service as backups. The backups are stored as zip files with names corresponding to the location archived (e.g., desktop.zip, downloads.zip).
You can use Windows task scheduler to execute this script every night. You can follow the steps outlined below:
- Make sure you have Python installed on your Windows machine.
-
Clone the repository
git clone https://github.com/Gruzjan/backup.git -
Download the required Python packages:
pip install -r requirements.txt -
Remove
.examplefrom your.envand adjust it to your needs. Note the backslashes and semicolons to seperate multiple paths:
LOGIN = your_mega_login
PASSWORD = your_mega_password
PATHS = your_path_1;your_path_2
To schedule the script to run automatically at 2 am every day, you can use the Windows Task Scheduler.
-
Open the Task Scheduler by pressing
Win + Rand typingtaskschd.msc. -
Click on "Create Basic Task" in the "Actions" pane on the right.
-
Provide a name and description for the task (e.g., "Backup Script").
-
Choose "Daily" as the trigger and set the recurring frequency to "1" day. Select the desired start date and set the start time to "2:00 AM". Click "Next".
-
Choose "Start a program" as the action and browse to select the Python executable (
python.exe). If you installed Python in the default location, the path should be something likeC:\Python39\python.exe. In the "Add arguments" field, enter the path to thebackup_script.pyfile. Click "Next". -
Review the task summary and click "Finish" to create the scheduled task.
The script will now be executed automatically every day at 2 am, and the specified locations will be backed up to your Mega account.
Feel free to customize the script and the scheduled task settings according to your requirements :))