cli tools for making backups
rclone - sync files with remove repo using
sudo apt install rclone
rclone --versionrclone config
vim $HOME/.config/rclone/rclone.confrclone config
n
gdrive_vitalii
... - Enter
nto create a new remote. - Enter a name for your remote (e.g.,
mega_backup). - When prompted for the Storage type, enter the number corresponding to Mega (or type
mega). - Enter your User name (your MEGA email address).
- When prompted for the Password, enter
yto type in your own password. You will enter and confirm your MEGA password. rclone will store this password encrypted in the configuration file. - ...
- Finally, enter
yto confirm and save the new remote.
rclone lsd mega_backup:/# https://rclone.org/commands/rclone_ls/
rclone ls gdrive_vitalii:/
rclone lsl --files-only --max-depth 1 gdrive_vitalii:/
# [rclone check size of repo with ncdu](https://rclone.org/commands/rclone_ncdu/)
rclone ncdu gdrive_vitalii:/
rclone copy gdrive_vitalii:/books/reading-repeat/interview/20210830_173607.jpg ~/Downloads/interview.jpg
rifle ~/Downloads/interview.jpgrclone serve http --addr 127.0.0.1:8000 gdrive_vitalii:/
x-www-browser http://127.0.0.1:8000/# start http server: rclone serve http....
rclone serve http --addr 127.0.0.1:8000 gdrive_vitalii:/ --rc
rclone rc --url http://127.0.0.1:5572 rc/noop
curl -X POST 'http://localhost:5572/rc/noop?potato=1&sausage=2'
rclone rc --url http://127.0.0.1:5572/ operations/list remote=gdrive_vitalii fs=/ opt='{"showHash": true}'
# start server to use for restic app
rclone serve restic
rclone serve restic --addr :8080 mega_backup:backup_foldersudo apt install resticset default repo
export RESTIC_REPOSITORY=rest:http://localhost:8080/
# export RESTIC_PASSWORD## repository based on local folder
restic init -r /path/to/repo
## repository based on sftp
restic init -r sftp:user@host:/path/to/repo
## repository based on rclone
RCLONE_REMOTE_NAME=gdrive_vitalii
PATH_IN_REMOTE=/my_folder
restic init --repo rclone:${RCLONE_REMOTE_NAME}:${PATH_IN_REMOTE}## create backup
restic -r /path/to/repo backup /path/to/data
## list of all snapshots
restic -r /path/to/repo snapshots
## remove old snapshots
restic -r /path/to/repo forget --prune --keep-last 5
## restore snapshot to a target directory
restic -r /path/to/repo restore latest --target /path/to/restore
## check remote repo
restic -r /path/to/repo check# Create a new repository (repo)
borg init -e repokey /path/to/repo
# Create a new backup archive (snapshot) of a directory
borg create /path/to/repo::archive_name /path/to/backup
# List all archives in the repository
borg list /path/to/repo
# Remove old archives based on a retention policy
borg prune --keep-daily 7 --keep-weekly 4 /path/to/repo
# Extract a specific archive to a target directory
borg extract /path/to/repo::archive_name --to /path/to/restore
# Mount an archive as a FUSE filesystem for easy browsing
borg mount /path/to/repo::archive_name /mnt/borg