Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sogladev/cronjobs-rsync-rclone-backups

Easy daily automated backups to local and remote drives with cronjobs, rsync and rclone
https://github.com/sogladev/cronjobs-rsync-rclone-backups

Last synced: about 1 month ago
JSON representation

Easy daily automated backups to local and remote drives with cronjobs, rsync and rclone

Awesome Lists containing this project

README

        

# cronjobs-rsync-rclone-backups
Automated backups to local and remote drives with cronjobs, using rsync and rclone

We can specify which files to upload with filters (`*.txt`) and upload to multiple cloud drives with variable data cap limits

In the end crontab will look like this with easy expansion of drives and selection of files to backup

## Requirements

* Crontab
* rsync
* [Rclone](https://rclone.org/)

## Setup

- [ ] create rsync directories for local backup

- [ ] setup rclone for remote backup with remote accounts (onedrive, googledrive, mega, etc.)

- [ ] create filters (`.txt`)

- [ ] edit `crontab -e`

### rsync
Configure $DRIVE and edit filter as needed

create folders if they do not exist

```
DRIVE=/media/${USER}/Backups/${FREQUENCY}
create
/media/user/Backups/weekly/
/media/user/Backups/daily/
```

### [Rclone](https://rclone.org/)

Install Rclone https://rclone.org/install/

Setup remote account(s), my preference https://mega.nz/

Step through Configuration with `rclone config` specific to type of Storage. See docs for specific instructions https://rclone.org/docs/

We can call `rsync.sh` and fill in Drive and Files (filter)

`export DRIVE=user_mega; export FILES=critical;"$CRONJOBS"/rclone.sh`

Refreshing tokens:
Needed for onedrive. `rclone config` Select onedrive -> have token (y/n) --y--> opens browser for sign in

### What to backup? Defining filters
Filters for rclone `filter_critical.txt` defined as `filter_{FILES}.txt`

## Put filters and scripts in their locations

Put `*.sh` scripts and filters `*.txt` in `~/scripts/cronjobs`