Answer the question
In order to leave comments, you need to log in
How to set up a cumulative Backup on a remote VPS?
Can you tell me how to write a script for a storage backup of a server on a remote VPS? Everywhere CentOS.
Those. so that only new and changed files are copied daily. I can't gobble up anything like this...
Answer the question
In order to leave comments, you need to log in
Use rsync with the --link-dest option - the first backup copies all files, the next only new and changed ones.
The link to the article indicated by script88 should help you write your own script, the main thing is to refuse to use ssh - this greatly slows down the transfer, rsync has built-in authorization mechanisms through files.
Rsnapshot(http://www.rsnapshot.org/) for example. And collect via ssh from the remote server using key authorization.
Everything is done very simply through a bash script. which archives the data and uploads it to the backup server. There is even a whole article on Habré Put the script in the
PROFIT cron
#!/bin/bash
set_vars () {
chroot_dest=/
#db_list=$(chroot ${chroot_dest}/ /usr/bin/mysql -e 'show databases;' | egrep -v '("+--"|Database|mysql|information_schema|performance_schema)')
backupdate=$(date +%Y%m%d-%H%M)
backup_dest=/backup2/dom0
backup_dest_chroot=${backup_dest}/rootfs/
backup_dest_mysqldumps=${backup_dest}/mysqldumps/
exclude_list=/etc/backup/exclude-dom0.list
}
rdiff_backup () {
#set -x
/usr/bin/rdiff-backup --print-statistics --exclude-sockets --preserve-numerical-ids --exclude-globbing-filelist ${exclude_list} ${chroot_dest} ${backup_dest_chroot}
}
set_vars
rdiff_backup
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question