-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve backup and restore procedure #320
Changes from 1 commit
83936e9
ddf511a
e3764bf
33dbddf
082b770
783c803
92e7ca1
09b0114
76ac512
90e564a
4e8a82f
631f2cf
8ca99bc
dbc5ba2
72a56b3
24cc85e
9a30677
5878591
53a2c7c
8471ae1
29a3061
f48123e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,8 @@ | |
# openvario/backup/<MAC address of eth0>/ | ||
# So you can store backups from more than one OV on the same stick! | ||
|
||
echo ' [..........] Starting' | ||
echo ' [#.........] Wait until "DONE !!" appears before you exit!' | ||
echo ' [==========] Starting' | ||
echo ' [#=========] Wait until "DONE !!" appears before you exit!' | ||
|
||
# Provident background system buffer sync to help later syncs finish quicker | ||
sync& | ||
|
@@ -49,7 +49,7 @@ restore() { | |
rsync --recursive --mkpath --checksum --quiet --progress "$1" "$2" | ||
test ${RSYNC_EXIT:=$?} -eq 0 | ||
then | ||
echo " [####......] All $3 files have been restored." | ||
echo " [####======] All $3 files have been restored." | ||
else | ||
>&2 echo " An rsync error $RSYNC_EXIT has occurred!" | ||
fi | ||
|
@@ -59,7 +59,7 @@ restore() { | |
|
||
case `basename "$0"` in | ||
backup-system.sh) | ||
echo ' [##........] System check ...' | ||
echo ' [##========] System check ...' | ||
|
||
# Store SSH status | ||
if /bin/systemctl --quiet is-enabled dropbear.socket | ||
|
@@ -81,7 +81,7 @@ backup-system.sh) | |
# Copy brightness setting | ||
cat /sys/class/backlight/lcd/brightness > /home/root/brightness | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we ever implement some dynamic brightness setting, this would write the current (adapted) brightness into the backup, instead of a configured value. Where is the configured value saved? |
||
echo ' [####......] Starting backup ...' | ||
echo ' [####======] Starting backup ...' | ||
# Copy all directories and files from list below to backup directory recursively. | ||
# We use --checksum here due to cubieboards not having an rtc clock | ||
if | ||
|
@@ -100,18 +100,18 @@ backup-system.sh) | |
LISTE | ||
test ${RSYNC_EXIT:=$?} -eq 0 | ||
then | ||
echo ' [######....] All files and settings have been backed up.' | ||
echo ' [######====] All files and settings have been backed up.' | ||
else | ||
>&2 echo " An rsync error $RSYNC_EXIT has occurred!" | ||
fi;; | ||
|
||
restore-xcsoar.sh) | ||
echo ' [##........] Starting restore of XCSoar ...' | ||
echo ' [##========] Starting restore of XCSoar ...' | ||
# Call Shell Function defined above | ||
restore "$USB_PATH/$BACKUP/$MAC/$XCSOAR_PATH"/ "$XCSOAR_PATH"/ XCSoar;; | ||
|
||
restore-system.sh) | ||
echo ' [##........] Starting restore ...' | ||
echo ' [##========] Starting restore ...' | ||
|
||
# Eliminate /etc/opkg backup in case it's present | ||
rm -rf "$USB_PATH/$BACKUP/$MAC"/etc/opkg/ | ||
|
@@ -123,37 +123,37 @@ restore-system.sh) | |
case `cat /home/root/ssh-status` in | ||
enabled) | ||
/bin/systemctl enable --quiet --now dropbear.socket | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. enabling does not start the dropbear daemon. This needs a start in addtion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's right! I'll add it. |
||
echo " [####......] SSH has been enabled permanently.";; | ||
echo " [####======] SSH has been enabled permanently.";; | ||
temporary) | ||
/bin/systemctl disable --quiet --now dropbear.socket | ||
/bin/systemctl start --quiet --now dropbear.socket | ||
echo " [####......] SSH has been enabled temporarily.";; | ||
echo " [####======] SSH has been enabled temporarily.";; | ||
disabled) | ||
/bin/systemctl disable --quiet --now dropbear.socket | ||
echo " [####......] SSH has been disabled.";; | ||
echo " [####======] SSH has been disabled.";; | ||
esac | ||
|
||
# Restore variod and sensord status | ||
for DAEMON in variod sensord | ||
do | ||
case `cat /home/root/$DAEMON-status` in | ||
enabled) /bin/systemctl enable --quiet --now $DAEMON | ||
echo " [#####.....] $DAEMON has been enabled.";; | ||
echo " [#####=====] $DAEMON has been enabled.";; | ||
disabled) /bin/systemctl disable --quiet --now $DAEMON | ||
echo " [#####.....] $DAEMON has been disabled.";; | ||
echo " [#####=====] $DAEMON has been disabled.";; | ||
esac | ||
done | ||
|
||
# Restore brightness setting | ||
cat /home/root/brightness > /sys/class/backlight/lcd/brightness | ||
echo " [######....] brightness setting has been restored.";; | ||
echo " [######====] brightness setting has been restored.";; | ||
*) | ||
>&2 echo 'call as backup-system.sh, restore-xcsoar.sh or restore-system.sh' | ||
exit 1;; | ||
esac | ||
|
||
# Sync the system buffer to make sure all data is on disk | ||
echo ' [#######...] Please wait a moment, synchronization is not yet complete!' | ||
echo ' [#######===] Please wait a moment, synchronization is not yet complete!' | ||
sync | ||
echo ' [##########] DONE !! ---------------------------------------------------' | ||
exit $RSYNC_EXIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this .. an improvement? How? Replace on kind of ASCII art with another? I think the dots are a better "background" graphic, but that's a question of taste.
I think any effort here is useless, because I expect all of this to be replaced with a GUI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an improvement, because the menu-x uses proportional font, so we have to change the characters for the bar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, this is about displaying a progress bar after the fact from a log file? It doesn't make sense to display a progress bar when the process has already finished, does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The echo displays line by line in the console during the script's execution. So it really gives an impression of the ongoing progress.