Modifiche agli script per rsync

Spostati script esistenti sotto la cartella `rsync/bin/`.
Modificati script esistenti, al fine di usare variabili, ove possibile,
per indicare il percorso della destinazione.
Rinominato `rsync-Linux-backup.sh` in `rsync-Backup.sh`.
Aggiunto file `exclude-Data.txt` che elenca file/cartelle da escludere
nel backup della cartella `/Data` sul disco esterno 'Backup'.
Aggiunti nuovi script per casi particolari.
This commit is contained in:
Luca Pellegrini 2023-02-03 16:03:28 +01:00
parent edbd3baaba
commit 15f8bb5031
11 changed files with 180 additions and 99 deletions

View File

@ -0,0 +1,13 @@
# cartelle e file nella partizione Data, da escludere nei backup con rsync
.Trash-1000/
.vscode-oss/
imm-disco/
Immagini/temp/
musica-altro/
Musica/Downloads/
Nextcloud/**
SCGP/Immagini/
Programmazione/venv/
temp/
VMs/

56
rsync/bin/rsync-Backup.sh Executable file
View File

@ -0,0 +1,56 @@
#!/bin/bash
MNT_POINT='/media/luca/Backup'
# Partizione "Data"
EXCLUDES=$HOME/bin/exclude-Data.txt
rsync -av --exclude-from=$EXCLUDES --delete /Data/ $MNT_POINT/Data/
#rsync -av --mkpath /Data/imm-disco/ $MNT_POINT/imm-disco/
# Linux Mint 21
rsync -av --mkpath --delete $HOME/Scaricati/ $MNT_POINT/Linux_Mint/Scaricati/
rsync -av --mkpath --delete $HOME/Scrivania/ $MNT_POINT/Linux_Mint/Scrivania/
## Config files (Git repository)
rsync -av --mkpath --delete $HOME/config-files/ $MNT_POINT/Linux_Mint/config-files/
## file nascosti
#rsync -av --mkpath $HOME/.thunderbird/ $MNT_POINT/Linux_Mint/.thunderbird/
#rsync -av --mkpath $HOME/.gnupg/ $MNT_POINT/Linux_Mint/.gnupg/
# Fedora KDE
#rsync -av --mkpath --delete $HOME/Scaricati/ $MNT_POINT/Fedora/Scaricati/
#rsync -av --mkpath --delete $HOME/Scrivania/ $MNT_POINT/Fedora/Scrivania/
## Config files (Git repository)
#rsync -av --mkpath --delete $HOME/config-files/ $MNT_POINT/Fedora/config-files/
# home (generica)
rsync -av --mkpath $HOME/Pubblici/ $MNT_POINT/home/Pubblici/
rsync -av --mkpath $HOME/Modelli/ $MNT_POINT/home/Modelli/
## bin
rsync -av --mkpath $HOME/bin/ $MNT_POINT/home/bin/
rsync -av --mkpath $HOME/.local/bin/ $MNT_POINT/home/.local/bin/
## file nascosti
rsync -av --mkpath $HOME/.local/share/strawberry/ $MNT_POINT/home/.local/share/strawberry/
rsync -av --mkpath $HOME/.config/strawberry/ $MNT_POINT/home/.config/strawberry/
rsync -a --mkpath --delete $HOME/.local/share/TelegramDesktop/ $MNT_POINT/home/.local/share/TelegramDesktop/
## themes e icons
#rsync -av --mkpath --delete $HOME/.icons/ $MNT_POINT/home/.icons/
#rsync -av --mkpath --delete $HOME/.themes/ $MNT_POINT/home/.themes/
## altro
rsync -av --mkpath --delete $HOME/CD-audio/ $MNT_POINT/home/CD-audio/
## VSCodium extensions
#rsync -a --mkpath --delete $HOME/.vscode-oss/extensions/ $MNT_POINT/home/.vscode-oss/extensions/
## SSH keys
#rsync -av --mkpath $HOME/.ssh/ $MNT_POINT/home/.ssh/
# Argomenti di rsync
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -0,0 +1,56 @@
#!/bin/bash
MNT_POINT='/media/luca/Backup'
# Partizione "Data"
EXCLUDES=$HOME/bin/exclude-Data.txt
rsync -av -n --exclude-from=$EXCLUDES --delete /Data/ $MNT_POINT/Data/
#rsync -av --mkpath -n /Data/imm-disco/ $MNT_POINT/imm-disco/
# Linux Mint 21
rsync -av --mkpath -n --delete $HOME/Scaricati/ $MNT_POINT/Linux_Mint/Scaricati/
rsync -av --mkpath -n --delete $HOME/Scrivania/ $MNT_POINT/Linux_Mint/Scrivania/
## Config files (Git repository)
rsync -av --mkpath -n --delete $HOME/config-files/ $MNT_POINT/Linux_Mint/config-files/
## file nascosti
#rsync -av --mkpath -n $HOME/.thunderbird/ $MNT_POINT/Linux_Mint/.thunderbird/
#rsync -av --mkpath -n $HOME/.gnupg/ $MNT_POINT/Linux_Mint/.gnupg/
# Fedora KDE
#rsync -av --mkpath -n --delete $HOME/Scaricati/ $MNT_POINT/Fedora/Scaricati/
#rsync -av --mkpath -n --delete $HOME/Scrivania/ $MNT_POINT/Fedora/Scrivania/
## Config files (Git repository)
#rsync -av --mkpath -n --delete $HOME/config-files/ $MNT_POINT/Fedora/config-files/
# home (generica)
rsync -av --mkpath -n $HOME/Pubblici/ $MNT_POINT/home/Pubblici/
rsync -av --mkpath -n $HOME/Modelli/ $MNT_POINT/home/Modelli/
## bin
rsync -av --mkpath -n $HOME/bin/ $MNT_POINT/home/bin/
rsync -av --mkpath -n $HOME/.local/bin/ $MNT_POINT/home/.local/bin/
## file nascosti
rsync -av --mkpath -n $HOME/.local/share/strawberry/ $MNT_POINT/home/.local/share/strawberry/
rsync -av --mkpath -n $HOME/.config/strawberry/ $MNT_POINT/home/.config/strawberry/
rsync -a --mkpath -n --delete $HOME/.local/share/TelegramDesktop/ $MNT_POINT/home/.local/share/TelegramDesktop/
## themes e icons
#rsync -av --mkpath -n --delete $HOME/.icons/ $MNT_POINT/home/.icons/
#rsync -av --mkpath -n --delete $HOME/.themes/ $MNT_POINT/home/.themes/
## altro
rsync -av --mkpath -n --delete $HOME/CD-audio/ $MNT_POINT/home/CD-audio/
## VSCodium extensions
#rsync -a --mkpath -n --delete $HOME/.vscode-oss/extensions/ $MNT_POINT/home/.vscode-oss/extensions/
## SSH keys
#rsync -av --mkpath -n $HOME/.ssh/ $MNT_POINT/home/.ssh/
# Argomenti di rsync
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -0,0 +1,18 @@
#!/bin/bash
MNT_POINT='/media/luca/HDD-1'
rsync -av -n --mkpath /Data/temp/ $MNT_POINT/temp/
# Audio e Video
MULTIMEDIA=$MNT_POINT/Multimedia
rsync -av -n --mkpath /Data/Immagini/ $MULTIMEDIA/Immagini/
rsync -av -n --mkpath --delete /Data/Musica/ $MULTIMEDIA/Musica/
rsync -av -n --mkpath /home/luca/CD-audio/ $MULTIMEDIA/musica-altro/CD-audio/
rsync -av -n --mkpath /Data/Podcast/ $MULTIMEDIA/Podcast/
rsync -av -n --mkpath /Data/Video/ $MULTIMEDIA/Video/
# Documenti e altro
DOCS=$MNT_POINT/Documenti_e_altro
rsync -av -n --mkpath /Data/Libri/ $DOCS/Libri/

18
rsync/bin/rsync-HDD-1.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
MNT_POINT='/media/luca/HDD-1'
rsync -av --mkpath /Data/temp/ $MNT_POINT/temp/
# Audio e Video
MULTIMEDIA=$MNT_POINT/Multimedia
rsync -av --mkpath /Data/Immagini/ $MULTIMEDIA/Immagini/
rsync -av --mkpath --delete /Data/Musica/ $MULTIMEDIA/Musica/
rsync -av --mkpath /home/luca/CD-audio/ $MULTIMEDIA/musica-altro/CD-audio/
rsync -av --mkpath /Data/Podcast/ $MULTIMEDIA/Podcast/
rsync -av --mkpath /Data/Video/ $MULTIMEDIA/Video/
# Documenti e altro
DOCS=$MNT_POINT/Documenti_e_altro
rsync -av --mkpath /Data/Libri/ $DOCS/Libri/

View File

@ -0,0 +1,16 @@
#!/bin/bash
MNT_POINT='/media/luca/LUCA-32GB'
rsync -av -n --delete --exclude "Downloads" /Data/Musica/ $MNT_POINT/Musica/
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -0,0 +1,3 @@
#!/bin/bash
rsync -av --delete --exclude "Downloads" /Data/Musica/ /run/media/luca/SD-CARD/Musica/

View File

@ -1,43 +0,0 @@
#!/bin/bash
# Partizione "Data"
rsync -avn --exclude 'imm-disco' --exclude 'Immagini/temp' --exclude 'musica-altro' --exclude 'VMs' --exclude 'SCGP/Immagini' --exclude 'temp' --delete /Data/ /media/luca/Linux-backup/Data/
#rsync -av /Data/imm-disco/ /media/luca/Linux-backup/imm-disco/
# Linux Mint 21
rsync -avn --delete /home/luca/Scaricati/ /media/luca/Linux-backup/Linux_Mint_21/Scaricati/
rsync -avn --delete /home/luca/Scrivania/ /media/luca/Linux-backup/Linux_Mint_21/Scrivania/
#rsync -av /home/luca/Pubblici/ /media/luca/Linux-backup/Linux_Mint_21/Pubblici/
rsync -avn /home/luca/Modelli/ /media/luca/Linux-backup/Linux_Mint_21/Modelli/
## file nascosti
rsync -avn --delete /home/luca/.thunderbird/ /media/luca/Linux-backup/Linux_Mint_21/.thunderbird/
rsync -avn /home/luca/.gnupg/ /media/luca/Linux-backup/Linux_Mint_21/.gnupg/
rsync -avn /home/luca/.local/share/strawberry/ /media/luca/Linux-backup/Linux_Mint_21/.local/share/strawberry/
rsync -avn --delete /home/luca/.local/share/TelegramDesktop/ /media/luca/Linux-backup/Linux_Mint_21/.local/share/TelegramDesktop/
## themes e icons
#rsync -avn --delete /home/luca/.icons/ /media/luca/Linux-backup/Linux_Mint_21/.icons/
rsync -avn --delete /home/luca/.themes/ /media/luca/Linux-backup/Linux_Mint_21/.themes/
# Home directory (generale)
rsync -avn --delete /home/luca/CD-audio/ /media/luca/Linux-backup/home/CD-audio/
## Configuration files
rsync -avn --delete /home/luca/config-files/ /media/luca/Linux-backup/home/config-files/
## VSCodium extensions
rsync -avn --delete /home/luca/.vscode-oss/extensions/ /media/luca/Linux-backup/home/.vscode-oss/extensions/
## SSH keys
rsync -avn /home/luca/.ssh/ /media/luca/Linux-backup/home/.ssh/
# bin
rsync -avn /home/luca/.local/bin/ /media/luca/Linux-backup/home/.local/bin/
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -1,12 +0,0 @@
#!/bin/bash
# Audio e Video
rsync -av /Data/Immagini/ /media/luca/HDD-1/Multimedia/Immagini/
rsync -av --delete /Data/Musica/ /media/luca/HDD-1/Multimedia/Musica/
rsync -av /home/luca/CD-audio/ /media/luca/HDD-1/Multimedia/musica-altro/CD-audio/
rsync -av /Data/Podcast/ /media/luca/HDD-1/Multimedia/Podcast/
rsync -av /Data/Video/ /media/luca/HDD-1/Multimedia/Video/
# Documenti e altro
rsync -av /Data/Libri/ /media/luca/HDD-1/Documenti_e_altro/Libri/

View File

@ -1,43 +0,0 @@
#!/bin/bash
# Partizione "Data"
rsync -av --exclude 'imm-disco' --exclude 'Immagini/temp' --exclude 'musica-altro' --exclude 'VMs' --exclude 'SCGP/Immagini' --exclude 'temp' --delete /Data/ /media/luca/Linux-backup/Data/
#rsync -av /Data/imm-disco/ /media/luca/Linux-backup/imm-disco/
# Linux Mint 21
rsync -av --delete /home/luca/Scaricati/ /media/luca/Linux-backup/Linux_Mint_21/Scaricati/
rsync -av --delete /home/luca/Scrivania/ /media/luca/Linux-backup/Linux_Mint_21/Scrivania/
#rsync -av /home/luca/Pubblici/ /media/luca/Linux-backup/Linux_Mint_21/Pubblici/
rsync -av /home/luca/Modelli/ /media/luca/Linux-backup/Linux_Mint_21/Modelli/
## file nascosti
rsync -av --delete /home/luca/.thunderbird/ /media/luca/Linux-backup/Linux_Mint_21/.thunderbird/
rsync -av /home/luca/.gnupg/ /media/luca/Linux-backup/Linux_Mint_21/.gnupg/
rsync -av /home/luca/.local/share/strawberry/ /media/luca/Linux-backup/Linux_Mint_21/.local/share/strawberry/
rsync -av --delete /home/luca/.local/share/TelegramDesktop/ /media/luca/Linux-backup/Linux_Mint_21/.local/share/TelegramDesktop/
## themes e icons
#rsync -av --delete /home/luca/.icons/ /media/luca/Linux-backup/Linux_Mint_21/.icons/
rsync -av --delete /home/luca/.themes/ /media/luca/Linux-backup/Linux_Mint_21/.themes/
# Home directory (generale)
rsync -av --delete /home/luca/CD-audio/ /media/luca/Linux-backup/home/CD-audio/
## Configuration files
rsync -av --delete /home/luca/config-files/ /media/luca/Linux-backup/home/config-files/
## VSCodium extensions
rsync -av --delete /home/luca/.vscode-oss/extensions/ /media/luca/Linux-backup/home/.vscode-oss/extensions/
## SSH keys
rsync -av /home/luca/.ssh/ /media/luca/Linux-backup/home/.ssh/
# bin
rsync -av /home/luca/.local/bin/ /media/luca/Linux-backup/home/.local/bin/
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -1 +0,0 @@
rsync -av --delete --exclude ".thumbnails" /home/luca/Musica/ /media/luca/3335-3239/Music/