A script to create backups on linux systems.
Install rClone and set up your preferred cloud storage
curl https://rclone.org/install.sh | sudo bash
rclone config
- To use a specific folder in your cloud storage, fill in the
root_folder_id
value- Example: If you use pCloud, you can navigate to a folder and copy the folder ID from the url bar
- If you are on a headless machine, you might need to download rClone on a device with access to an internet browser
- In Windows, open
cmd
and navigate to the folder with therclone.exe
file - Paste the displayed command into
cmd
and paste the response back into the rClone configuration.
- In Windows, open
Install tmux and create new session for mounting
apt install tmux
tmux new -s backup
# <name> is the name you chose for the remote in the rclone config
rcloune mount <name>: /path/to/empty/folder --vfs-cache-mode writes
Clone this repository and edit config.py
git clone https://github.com/tibue99/linux-backup
End mounting
fusermount -uz /linux/path
python3 backup.py
Set a cronjob to backup periodically. This cronjob creates a backup every day at 3 AM.
crontab -e
0 3 * * * python3 /path/to/backup.py
# View cronjobs
crontab -l
This repository is based on the code of Tutorialwork.