-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup.sh
More file actions
46 lines (42 loc) · 2.4 KB
/
Copy pathbackup.sh
File metadata and controls
46 lines (42 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# function partbkp { # $1 : Partition ID (sdXY) ; $2 : Output file
# sudo dd if="/dev/$1" conv=sync,noerror bs=64K "of=$2"
# }
function gahag-replica {
# add --delete flag to delete extraneous files from the
# receiving side (ones that aren’t on the sending side).
rsync -av --delete --delete-excluded \
--exclude='.git/' \
--exclude='.svn/' \
--exclude='.stack-work/' \
--exclude='.ccls-cache/' \
--exclude='target/' \
--exclude='virtualenv/' \
--exclude='bin/' \
--exclude='obj/' \
--exclude='gahag/media/cinematography' \
--exclude='gahag/torrents' \
--exclude='gahag/games/r36s.iso' \
--exclude='gahag/oss/installers/**/*.iso' \
/gahag "/run/media/gahag/59296a1c-5568-49e2-bb7e-180383ae9432/" 2>&1 \
| tee $(date '+%Y-%m-%dT%H.%M.%S-rsync.log')
}
function gahag-backup {
tar -cvpzf "/run/media/gahag/Backup/backup.$(date '+%Y-%m-%d').tar.gz" \
--exclude='*/.git' \
--exclude='*/.svn' \
--exclude='*/.stack-work' \
--exclude='*/.ccls-cache' \
--exclude='*/target' \
--exclude='*/virtualenv' \
--exclude='*/bin' \
--exclude='*/obj' \
--exclude='media/cinematography' \
--exclude='/torrents' \
/gahag 2>&1 \
| tee $(date '+%Y-%m-%dT%H.%M.%S-rsync.log')
}
function gahag-backup-restore {
tar -xvpzf "/run/media/gahag/Backup/backup.$@.tar.gz" \
-C /gahag-restore \
--numeric-owner
}