dima73 / automatic-full-backup Goto Github PK
View Code? Open in Web Editor NEWautomatic full backup and manual flashing image for enigma2 box
automatic full backup and manual flashing image for enigma2 box
First of all a big thanks for this valuable plugin.
There is a small problem when using the plugin on Uno 4K. As you might know the VU+ Uno 4K flashes the Backup Files by checking the "force.update" file in BackUp folder without confirmation by using the power button. This means the Uno4k flashes the Backup when the receiver is booting or rebooting. No confirmation is needed. The "force.update" file can be renamed to "noforce.update" of course but this just helps until next automatic BackUp creation. All files in Backup folder will be deleted and new Backup files will be saved including a new "force.update". Would it be possible to include a check for noforce.update and if existing in folder not to create a new force.update? Maybe you have a better solution.
Anyway, this plugin is a "Must have" for E2.
I am using VTI 11.0.1 with all the current updates and v5 of afb,
but most of the backups in the night crash enigma2 (Display shows the time of the start of the backup, box is reachable via network, enigma2 is shown as defunct())
unfortunately there is nothing in the debug.log which could help.
I had the same issue with all the previous versions as well.
It doesnt matter, if I write the backup to USB-stick(FAT32) or internal hdd(ext4)
Any suggestion what to check?
After discussing the topic in www.vuplus-support.org I discribe my problem here.
After installing the plugin it*s no problem to make a backup on HDD, but the restore fails.
My Ultimo4K has a internal 4TB HDD.
I forgot: Image ist VTI 11.0.1
Hi,
on my Solo 4K, I can choose /media/hdd as the backup folder and create a manual backup on my HDD. However, when I leave the plugin (via green button), the backup path will not be saved. Next time I enter the plugin, it just says "None" as backup folder.
Hi
I´m a VU+ Uno4k User on VTI 11.0.2 with all the current update and use the last afb 5.7
Backups creating fine, but if i want to reflashing my image with this backup, the box are doesn´t finish this. waiting over 2 hours but nothing happent, the loading bar still standing in the last area. i test this 5 times and it´s always the same, the flash process will never finish. turn off the box and they doesn´t start, the only way is to flash with usb stick
when i created a backup with the vti image and copy the files into the VUPlus Folder it´s working fine.
the imagesize are also different:
Automatic Full Backup = 584 MB
VTI Image Backup = 260 MB
Is it possible to modify the plug for py3?
I have Vu zero 4k and appear this message:
tar: ./var/lib/samba/private/msg.sock/1139: sockete ignored
1139 until 1347
See the pictures:
Hey can you fix this
https://github.com/Dima73/automatic-full-backup/blob/master/src/plugin.py#L664
This fail
Fail to Datum 21.01.2020 ?? Mmhh
Mfg
during automatically started backup the remote control of vu+ boxes is blocked and the spinner is shown. If you start AFB manually the box is fully controlable with the remote control. Is that a wanted behaviour?
Version 5.9 and 6.2 tested with VU+ Duo2 and VTi 13.0.2
Hi,
thanks to your version 6.6 which works when I do a command line backup, but doesn't on the automatic backup function. That means that only these files will be saved on the automatic backup:
-rw-r--r-- 1 nobody nogroup 15 Jan 13 04:00 imageversion
-rw-r--r-- 1 nobody nogroup 16777216 Jan 13 04:00 kernel_auto.bin
-rw-r--r-- 1 nobody nogroup 83 Jan 13 04:00 nomkpart.update
-rw-r--r-- 1 nobody nogroup 43 Jan 13 04:00 reboot.update
As you can see it differs from the manual backup which saves these files:
-rw-r--r-- 1 nobody nogroup 15 Jan 13 08:49 imageversion
-rw-r--r-- 1 nobody nogroup 16777216 Jan 13 08:49 kernel_auto.bin
-rw-r--r-- 1 nobody nogroup 83 Jan 13 08:49 nomkpart.update
-rw-r--r-- 1 nobody nogroup 0 Jan 13 08:49 openpli 7.0-rc
-rw-r--r-- 1 nobody nogroup 43 Jan 13 08:49 reboot.update
-rw-r--r-- 1 nobody nogroup 68019059 Jan 13 08:49 rootfs.tar.bz2
Any chance to check why this behavior happens?
Please can you supply a .bb in your git so this can be used to build the plugin directly and offer it from feeds.
Hi Dimitrij, I really like your plugin and hope that you will take some time and adjust automatic-fullbackup-vu4k.sh so Duo 4k and Zero 4k can also be supported.
I think only Uno 4k and Zero 4k have no display and need force.update files.
root@vuduo4k:~# cat /proc/stb/info/vumodel
duo4k
Kernel / Driver:
4.1.45 / 4.1.45-20181130.r0
Thank you!
#!/bin/sh
VERSION="vu4k models- 20/11/2017\ncreator of the script Dimitrij (http://forums.openpli.org)\n"
DIRECTORY="$1"
START=$(date +%s)
DATE=date +%Y%m%d_%H%M
IMAGEVERSION=date +%Y%m%d
MKFS=/bin/tar
BZIP2=/usr/bin/bzip2
ROOTFSTYPE="rootfs.tar.bz2"
WORKDIR="$DIRECTORY/bi"
getaddr() {
python - $1 $2<<-"EOF"
from sys import argv
filename = argv[1]
address = int(argv[2])
fh = open(filename,'rb')
header = fh.read(2048)
fh.close()
print "%d" % ( (ord(header[address+2]) <<16 ) | (ord(header[address+1]) << 8) | ord(header[address]) )
EOF
}
if [ -f /etc/issue ] ; then
ISSUE=cat /etc/issue | grep . | tail -n 1
IMVER=${ISSUE%?????}
elif [ -f /etc/bhversion ] ; then
ISSUE=cat /etc/bhversion | grep . | tail -n 1
IMVER=${ISSUE%?????}
elif [ -f /etc/vtiversion.info ] ; then
ISSUE=cat /etc/vtiversion.info | grep . | tail -n 1
IMVER=${ISSUE%?????}
elif [ -f /etc/vtiversion.info ] ; then
ISSUE=cat /etc/vtiversion.info | grep . | tail -n 1
IMVER=${ISSUE%?????}
elif [ -f /proc/stb/info/vumodel ] && [ -f /etc/version ] ; then
ISSUE=cat /etc/version | grep . | tail -n 1
IMVER=${ISSUE%?????}
else
IMVER="unknown"
fi
echo "Script date = $VERSION\n"
echo "Back-up media = $DIRECTORY\n"
df -h "$DIRECTORY"
echo "Back-up date_time = $DATE\n"
echo "Working directory = $WORKDIR\n"
echo -n "Drivers = "
opkg list-installed | grep dvb-proxy
CREATE_ZIP="$2"
IMAGENAME="$3"
if [ -f /proc/stb/info/vumodel ] ; then
MODEL=$( cat /proc/stb/info/vumodel )
if [ $MODEL = "solo4k" ] ; then
echo "Found VU+ Solo 4K\n"
MTD_KERNEL="mmcblk0p1"
KERNELNAME="kernel_auto.bin"
elif [ $MODEL = "uno4k" ] ; then
echo "Found VU+ Uno 4K\n"
MTD_KERNEL="mmcblk0p1"
KERNELNAME="kernel_auto.bin"
elif [ $MODEL = "uno4kse" ] ; then
echo "Found VU+ Uno 4K se\n"
MTD_KERNEL="mmcblk0p1"
KERNELNAME="kernel_auto.bin"
elif [ $MODEL = "ultimo4k" ] ; then
echo "Found VU+ Ultimo 4K\n"
MTD_KERNEL="mmcblk0p1"
KERNELNAME="kernel_auto.bin"
elif [ $MODEL = "duo4k" ] ; then
echo "Found VU+ Duo 4K\n"
MTD_KERNEL="mmcblk0p1"
KERNELNAME="kernel_auto.bin"
elif [ $MODEL = "zero4k" ] ; then
echo "Found VU+ Zero 4K\n"
MTD_KERNEL="mmcblk0p1"
KERNELNAME="kernel_auto.bin"
else
echo "No supported receiver found!\n"
exit 0
fi
TYPE=VU
SHOWNAME="Vu+ $MODEL"
MAINDEST="$DIRECTORY/vuplus/$MODEL"
EXTRA="$DIRECTORY/automatic_fullbackup/$DATE/vuplus"
echo "Destination = $MAINDEST\n"
else
echo "No supported receiver found!\n"
exit 0
fi
if [ ! -f $MKFS ] ; then
echo "NO TAR FOUND, ABORTING\n"
exit 0
fi
if [ ! -f "$BZIP2" ] ; then
echo "$BZIP2 not installed yet, now installing\n"
opkg update > /dev/null 2>&1
opkg install bzip2 > /dev/null 2>&1
echo "Exit, try again\n"
sleep 10
exit 0
fi
echo "Starting Full Backup!\nOptions control panel will not be available 2-15 minutes.\nPlease wait ..."
echo "--------------------------"
control_c(){
echo "Control C was pressed, quiting..."
umount /tmp/bi/root 2>/dev/null
rmdir /tmp/bi/root 2>/dev/null
rmdir /tmp/bi 2>/dev/null
rm -rf "$WORKDIR" 2>/dev/null
exit 255
}
trap control_c SIGINT
echo "\nWARNING!\n"
echo "To stop creating a backup, press the Menu button.\n"
sleep 2
rm -rf "$WORKDIR"
echo "Remove directory = $WORKDIR\n"
mkdir -p "$WORKDIR"
echo "Recreate directory = $WORKDIR\n"
mkdir -p /tmp/bi/root
echo "Create directory = /tmp/bi/root\n"
sync
mount --bind / /tmp/bi/root
#dd if=/dev/$MTD_KERNEL of=$WORKDIR/kernel.dump
#ADDR=$(getaddr $WORKDIR/kernel.dump 44)
#dd if=$WORKDIR/kernel.dump of=$WORKDIR/$KERNELNAME bs=$ADDR count=1 && rm $WORKDIR/kernel.dump
dd if=/dev/$MTD_KERNEL of=$WORKDIR/$KERNELNAME > /dev/null 2>&1
echo "Kernel resides on /dev/$MTD_KERNEL\n"
echo "Start creating rootfs.tar\n"
#$MKFS -jcf $WORKDIR/$ROOTFSTYPE -C /tmp/bi/root .
$MKFS -cf $WORKDIR/rootfs.tar -C /tmp/bi/root --exclude=/var/nmbd/* .
$BZIP2 $WORKDIR/rootfs.tar
TSTAMP="$(date "+%Y-%m-%d-%Hh%Mm")"
if [ $TYPE = "VU" ] ; then
rm -rf "$MAINDEST"
echo "Removed directory = $MAINDEST\n"
mkdir -p "$MAINDEST"
echo "Created directory = $MAINDEST\n"
mv "$WORKDIR/$KERNELNAME" "$MAINDEST/$KERNELNAME"
mv "$WORKDIR/$ROOTFSTYPE" "$MAINDEST/$ROOTFSTYPE"
echo "$MODEL-$IMAGEVERSION" > "$MAINDEST/imageversion"
if [ $MODEL = "uno4k" ] || [ $MODEL = "uno4kse" ] ; then
echo "rename this file to 'force.update' when need confirmation" > "$MAINDEST/noforce.update"
else
echo "This file forces a reboot after the update" > "$MAINDEST/reboot.update"
fi
if [ -z "$CREATE_ZIP" ] ; then
mkdir -p "$EXTRA/$MODEL"
echo "Created directory = $EXTRA/$MODEL\n"
touch "$MAINDEST/$IMVER"
cp -r "$MAINDEST" "$EXTRA"
touch "$DIRECTORY/automatic_fullbackup/.timestamp"
else
if [ $CREATE_ZIP != "none" ] ; then
echo "Create zip archive..."
cd $DIRECTORY && $CREATE_ZIP -r $DIRECTORY/backup-$IMAGENAME-$MODEL-$TSTAMP.zip . -i /$MODEL/*
cd
fi
fi
if [ -f "$MAINDEST/rootfs.tar.bz2" -a -f "$MAINDEST/$KERNELNAME" ] ; then
echo " "
echo "BACK-UP MADE SUCCESSFULLY IN: $MAINDEST\n"
else
echo " "
echo "Image creation FAILED!\n"
fi
fi
umount /tmp/bi/root
rmdir /tmp/bi/root
rmdir /tmp/bi
rm -rf "$WORKDIR"
sleep 5
END=$(date +%s)
DIFF=$(( $END - $START ))
MINUTES=$(( $DIFF/60 ))
SECONDS=$(( $DIFF-(( 60*$MINUTES ))))
if [ $SECONDS -le 9 ] ; then
SECONDS="0$SECONDS"
fi
echo "BACKUP FINISHED IN $MINUTES.$SECONDS MINUTES\n"
exit
Hi,
I would like to make a feature request:
On the VU+ models, it is not easily possible to select a (remote) backup location with different path, for example a NAS.
In Automatic Full Backup I can only choose between USB, mounted network share (autofs), etc.
In my example I have autofs correctly configured and have 4 mounts, but in automatic full backup plugin I onle get 2 destination points for the backup:
/media/usb
/media/net/autofs/NAS
I dont want the backup to be in /media/net/autofs/NAS. I rather would like to have the backup in a different folder location, in example /media/net/autofs/NAS/backups.
My problem is that the plugin gives me only the 2 backup destinations mentioned above.
It would be nice, if we could also add a new backup location manually with the On-Screen-Keyboard for example. Or you could make the mounted network share detection on the VU+ models a little bit better to also find and display the other correctly mounted autofs shares on the box.
Many thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.