Tag - Rsync - liczba wpisów 5

RSYNC - Backup przyrostowy do osobnego folderu Kategoria: Linux | Tagi: incremental, Rsync | Autor: Bartłomiej Gałęzia

Skrypt robiący kopię 1:1 z danego folderu a różnice zapisuje do osobnego katalogu.

#!/bin/bash
rsync -avb --delete --backup-dir=/home/folder_diff/backup_`date +%Y.%m.%d_%H:%M:%S` /home/folder1/ /home/folder2/

https://www.jveweb.net/en/archives/2011/02/using-rsync-and-cron-to-automate-incremental-backups.html

mkdir -p /skrypty/RSYNC_LOGS
mkdir -p /home/backup/databases
mkdir -p /home/backup/etc
mkdir -p /home/backup/skrypty
vim /skrypty/backup_bazy.sh
#!/bin/bash
DATE=`date "+%Y.%m.%d_%H.%M.%S"`                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                    
/usr/bin/mysqldump -uroot -plocalhost [nextclouddb] > /home/backup/databases/[nextclouddb]_$DATE.sql
chmod +x /skrypty/backup_bazy.sh
vim /skrypty/rsync_vps_nas.sh
#!/bin/bash

DATE=`date "+%Y.%m.%d_%H.%M.%S"`

rsync -aogv --log-file=/skrypty/RSYNC_LOGS/rsync_etc_$DATE.log /etc/* /home/backup/etc/
rsync -aogv --log-file=/skrypty/RSYNC_LOGS/rsync_skrypt_$DATE.log /skrypty/* /home/backup/skrypty/
rsync -aogv --exclude '*/.cache*' --log-file=/skrypty/RSYNC_LOGS/rsync_vps_nas_$DATE.log /home/* [rsyncuser]@[rsyncserver]:/home/[rsyncuser]/
chmod +x /skrypty/rsync_vps_nas.sh
ssh-keygen
ssh-copy-id [rsyncuser]@[rsynserver]
cd /skrypty
./backup_bazy.sh
./rsync_vps_nas.sh
crontab -e
0 0 * * * /skrypty/backup_bazy.sh
0 1 * * * /skrypty/rsync_vps_nas.sh

Rsync full system backup Kategoria: Linux | Tagi: Rsync | Autor: Bartłomiej Gałęzia

# rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folder

https://wiki.archlinux.org/index.php/full_system_backup_with_rsync

Rsync - tutorial Kategoria: Linux | Tagi: Rsync | Autor: Bartłomiej Gałęzia

http://linux.die.net/man/1/rsync

http://www.thegeekstuff.com/2010/09/rsync-command-examples/

 

sudo aptitude install rsync

rsync -av root@10.20.30.1:/home/* /mnt/home

 

-a option is a combination flag. It stands for "archive" and syncs recursively and preserves symbolic links, special and device files, modification times, group, owner, and permissions.

-z If you are transferring files that have not already been compressed, like text files, you can reduce the network transfer by adding compression with the -z option:

-P flag is very helpful. It combines the flags --progress and --partial. The first of these gives you a progress bar for the transfers and the second allows you to resume interrupted transfers

Rsync cały system Kategoria: Linux | Tagi: Rsync | Autor: Bartłomiej Gałęzia

boot from live-cd

fdisk /dev/sda 
n
p
[enter]
[enter]
+100G
n
p
[enter]
[enter]
+10G
n
p
[enter]
[enter]
[enter]
t
2
82
w

mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda3
mkswap /dev/sda2

blkid

mkdir /mnt/root
mkdir /mnt/home

mount /dev/sda1 /mnt/root
mount /dev/sda3 /mnt/home

### na kompie źródłowym ###
mkdir /mnt/rootsource
mount /dev/sda1 /mnt/rootsource
###########

rsync -av root@10.20.30.1:/mnt/rootvis5/* /mnt/root --exclude="/dev" --exclude="/sys" --exclude="/proc" --exclude="/home"  --exclude="/mnt"
rsync -av root@10.20.30.1:/home/* /mnt/home

mkdir /mnt/root/sys
mkdir /mnt/root/proc
mkdir /mnt/root/dev

mount -o bind /sys /mnt/root/sys
mount -o bind /proc /mnt/root/proc
mount -o bind /dev /mnt/root/dev

blkid
skopiować UUIDy

chroot /mnt/root
vim /etc/fstab

#aptitude purge grub grub-common
aptitude purge grub-common grub-gfxpayload-lists grub-pc grub-pc-bin grub2-common
aptitude 
install grub-pc (/dev/sda)

reboot


vim /etc/udev/rules.d/70-persistent-net.rules

usunąć stare wpisy



sudo echo driver4 > /etc/hostname
sudo mv /etc/hosts /etc/hosts_old
cat /etc/hosts_old | sed -e 's,vis5,driver4,g' > /etc/hosts
/etc/init.d/hostname start




#######
(echo t; echo 7;echo 83;echo p; echo w) | fdisk /dev/sdb 

Wyszukaj

Zapisz się do newsletera