Skip to content
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

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
83936e9
Squashed commit for Openvario merge request "improve backup and resto…
Jun 18, 2022
ddf511a
rearranging the menu items
Blaubart Jul 12, 2022
e3764bf
improve progress bar
Blaubart Jul 12, 2022
33dbddf
Moved system info functionality into new script system-info.sh. Exten…
7lima Jul 16, 2022
082b770
Update_Maps menu item moved from submenu_system to submenu_file
7lima Jul 17, 2022
783c803
Renaming, addition and reordering of backup/restore functions.
7lima Jul 17, 2022
92e7ca1
Complete rewrite and extension of lordfolken's transfer-xcsoar.sh.
7lima Jul 17, 2022
09b0114
Merge branch 'pull_request_315-branch' into pull_request_317-branch
7lima Jul 17, 2022
76ac512
Manually reverted my .gitignore customisations from former times.
7lima Jul 17, 2022
90e564a
Fixed newly introduced problems in menu code.
7lima Jul 17, 2022
4e8a82f
Update transfer-xcsoar.sh
Blaubart Aug 13, 2022
631f2cf
Update transfer-xcsoar.sh
Blaubart Aug 14, 2022
8ca99bc
Update transfer-xcsoar.sh
Blaubart Aug 15, 2022
dbc5ba2
Update transfer-xcsoar.sh
Blaubart Aug 15, 2022
72a56b3
implement automatic rotation after backup
Blaubart Mar 9, 2023
24cc85e
Update transfer-xcsoar.sh
Blaubart Mar 30, 2023
9a30677
bug fix - check if e2fsprogs is installed
Blaubart Mar 31, 2023
5878591
Bug fix - IP of eth0 and wlan0 was not found
Blaubart Apr 10, 2023
53a2c7c
add a new line at the end of the file
Blaubart Apr 10, 2023
8471ae1
removing double quote from the rotation value
Blaubart Apr 10, 2023
29a3061
Update openvario-image-testing.bb
Blaubart Apr 10, 2023
f48123e
restart tslib after restore
Blaubart Apr 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions meta-ov/recipes-apps/ovmenu-ng-skripts/files/transfer-xcsoar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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!'
Copy link
Collaborator

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.

Copy link
Contributor Author

@Blaubart Blaubart Jul 22, 2022

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.

Copy link
Collaborator

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?

Copy link

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.


# Provident background system buffer sync to help later syncs finish quicker
sync&
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -81,7 +81,7 @@ backup-system.sh)
# Copy brightness setting
cat /sys/class/backlight/lcd/brightness > /home/root/brightness

Copy link
Contributor

Choose a reason for hiding this comment

The 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
Expand All @@ -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/
Expand All @@ -123,37 +123,37 @@ restore-system.sh)
case `cat /home/root/ssh-status` in
enabled)
/bin/systemctl enable --quiet --now dropbear.socket
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link

Choose a reason for hiding this comment

The 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