-
Notifications
You must be signed in to change notification settings - Fork 14
/
backup-packagelist.sh
executable file
·59 lines (48 loc) · 2 KB
/
backup-packagelist.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#Ubuntu backup script - 2012-08-12 - Mark Rijckenberg - version 1.0
# Version 2.0 - 2015-10-11
PATH=/usr/sbin:/usr/bin:/sbin:/bin
#Prerequisites:
# USB drives SAMSUNG and IOMEGA need to be mounted correctly in order for this script to work correctly!
# https://github.com/MarkRijckenberg/rsync-time-backup.git
#define source directories
HOME=/home/ulysses/
SOURCE2=/etc/
SOURCE3=/media/windows/rsync/
#define target directories where backup will be stored
TARGET1=/media/SAMSUNG/$HOME/
TARGET2=/media/IOMEGA/$HOME/
TARGET7=/media/ulysses/BACKUP/$HOME/
TARGET3=/media/SAMSUNG/etc/
TARGET4=/media/IOMEGA/etc/
TARGET8=/media/ulysses/BACKUP/etc/
TARGET5=/media/SAMSUNG/media/windowsdata/rsync/
TARGET6=/media/IOMEGA/media/windowsdata/rsync/
sudo apt-get update
sudo apt-get install -y dselect rsync
sudo dpkg --get-selections > Package.list
sudo cp Package.list $TARGET1/Package.list
sudo cp Package.list $TARGET2/Package.list
sudo cp Package.list $TARGET3/Package.list
sudo cp Package.list $TARGET4/Package.list
sudo cp Package.list $TARGET5/Package.list
sudo cp Package.list $TARGET6/Package.list
sudo cp Package.list $TARGET7/Package.list
sudo cp Package.list $TARGET8/Package.list
sudo apt-key exportall > Repo.keys
sudo cp Repo.keys $TARGET1/Repo.keys
sudo cp Repo.keys $TARGET2/Repo.keys
sudo cp Repo.keys $TARGET3/Repo.keys
sudo cp Repo.keys $TARGET4/Repo.keys
sudo cp Repo.keys $TARGET5/Repo.keys
sudo cp Repo.keys $TARGET6/Repo.keys
sudo cp Repo.keys $TARGET7/Repo.keys
sudo cp Repo.keys $TARGET8/Repo.keys
sudo $HOME/rsync-time-backup/rsync_tmbackup.sh $HOME $TARGET1
sudo $HOME/rsync-time-backup/rsync_tmbackup.sh $HOME $TARGET2
sudo $HOME/rsync-time-backup/rsync_tmbackup.sh $HOME $TARGET7
sudo $HOME/rsync-time-backup/rsync_tmbackup.sh $SOURCE2 $TARGET3
sudo $HOME/rsync-time-backup/rsync_tmbackup.sh $SOURCE2 $TARGET4
sudo $HOME/rsync-time-backup/rsync_tmbackup.sh $SOURCE2 $TARGET8
sudo $HOME/rsync-time-backup/rsync_tmbackup.sh $SOURCE3 $TARGET5
sudo $HOME/rsync-time-backup/rsync_tmbackup.sh $SOURCE3 $TARGET6