forked from daverobertson63/RoboticsChallenge
-
Notifications
You must be signed in to change notification settings - Fork 2
/
do_backup.sh
executable file
·42 lines (35 loc) · 1.06 KB
/
do_backup.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
#!/bin/sh
cat <<__EOF__
About to update master image (hosted online) from local laptop
You will need to enter the local password for the robot user, when prompted
by sudo below - and then also the remote password for the master image (twice),
when prompted by rsync.
__EOF__
# First of all, clean up our image
sudo apt-get clean
# Update build date
convert ~/Customisations/Robot1-master.png \
-fill "#00afe9" \
-draw 'rectangle 0,0,87,25' \
-family Sans \
-weight bold \
-pointsize 10 \
+antialias \
-fill black \
-annotate +2+10 "Build Date:\n`date '+%Y-%m-%d %H:%M'`" \
~/Customisations/Robot1.png
sudo rsync -avxPz --delete \
--exclude=lost+found/ \
/boot/ \
[email protected]::backup_master1_boot/ && \
sudo rsync -avxPz --delete \
--exclude=lost+found/ \
--exclude=/tmp/ \
/ \
[email protected]::backup_master1_/
retval=$?
if [ $retval -eq 0 ]; then
read -p "Successfully backed up. Press ENTER to close" REPLY
else
read -p "Failed to back up due to one or more errors. Press ENTER to close, then please try again" REPLY
fi