Script python permettant d'automatiser la sauvegarde de dossier
Ce projet a ete realiser pour pratiquer l'automatisation sur linux et comprendre les problematiques reel de la gestion des systemes et de la sauvegarde.
- Sauvergarde automatique
- Compression des fichiers sauvegarde en .tar.gz
- Gestion de logs
- Configuration via un fichier JSON
- Automatisation avec cron
- Linux
- Python3
- Libraries : os, tarfile, json, datetime, logging
git clone https://github.com/kobzcode/linux-backup-automation.gitModifier le fichier config.json :
{
"source": "your folder source",
"destination": "your folder destination"
}python3 main.pycrontab -e
0 2 * * * /usr/bin/python3 /pwd/main.py2026-04-04 17:45:41,937 -- INFO -- Backup started
2026-04-04 17:45:41,947 -- INFO -- Backup created : backups/backup_2026-04-04.tar.gz
2026-04-04 17:45:41,947 -- INFO -- Backup done
backup_project/
├── main.py
├── config.json
├── logs/
└── backups/