Skip to content

shreshthadlakha/automatic-file-backup-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Automatic File Backup

Daily file backup can be cumbersome. But this Python-based Automatic File Backup Program solves that by automating the entire process. Once set up, it silently runs in the background, copying the contents of a source folder into a backup directory at a specified time every day, at a schedule time.

Table of Contents

-Overview
-Problem
-Tools
-Project Structure
-Key Things
-How to run this program
-Recommendations
-Builder Contact

Overview

This program is designed to: - Automatically back up files from a source folder to a destination folder.
- Create a new dated folder every day for each backup (e.g., Backups/2025-09-04).
- Run quietly in the background using the schedule module.

Problem

Manual file backups are:
- Easy to forget
- Time-consuming
- Prone to human error

There was a need for a simple, hands-off solution to automate the daily backup process — especially for users who want peace of mind when dealing with critical files.

Tools

- Python:- Programming language
- shutil:- For copying files and directories
- datetime:- For managing and formatting dates
- schedule:- To automate backup tasks
- time:- For checking and sleeping the loop
- os:- To handle filesystem paths

Project Structure

Automatic_File_Backup/
│
├── backup.py             # Main Python script to run the program
├── README.md             # Project documentation

Key Things

- Daily Scheduling: Uses schedule.every().day.at("HH:MM") to run once daily.
- Date-based Folders: Each backup is stored in a folder named with the current date.
- Error Handling: If the folder for that day already exists, it skips the backup and notifies the user.
- Modular Design: You can change the source/destination directories or backup time easily.

How to run this program

1. Install dependencies - using # pip install schedule
2. Edit script - change the time when you want to schedule the backup. The set sourceDirectory & destinationDirectory. Also set time.
3. Run the script.

Recommendations

- Run this script as a startup task or create a Windows scheduled task to ensure it starts automatically.
- Make sure the source and destination directories exist and are accessible.
- Consider logging backup status to a .log file for better tracking.
- Don’t schedule multiple backups at the same exact time.
- Backup to external drives or cloud-synced folders for extra safety.

Builder Contact

Shreshth Adlakha
Python Developer
shreshthaadlakha@gmail.com
LinkedIn

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages