mr-manuel / raspberry-pi-backup Goto Github PK
View Code? Open in Web Editor NEWThis script allows you to backup your Raspberry Pi to a SMB/CIFS share on a NAS/computer without removing the SD card.
License: MIT License
This script allows you to backup your Raspberry Pi to a SMB/CIFS share on a NAS/computer without removing the SD card.
License: MIT License
Hello,
i have running VenusOS Large on my RPI2.
if i start the ./backup i become this error message.
mkdir: can't create directory '/mnt2/imagebackupnlw/': Value too large for defined data type
Error when creating of the backup folder on the remote path.
on my other rasperrys with running raspian i can mout the same serverpath successful.
Hi, I tried your backup script right now for the first - many thanks for it! Of course, I have no old backup on the mounted drive. I got the following output:
root@raspberrypi2:~# /data/etc/raspberry-pi-backup/backup.sh
Mounting "//XXXXXXXX/backup" to "/mnt/backup"...
Creating "venus/" on backup mount...
Using script dd for backup.
15804000000 bytes (16 GB, 15 GiB) copied, 1343 s, 11.8 MB/s
15812+1 records in
15812+1 records out
15812526080 bytes (16 GB, 15 GiB) copied, 1354.37 s, 11.7 MB/s
Backup completed successfully.
head: invalid number '-5'
ls: /mnt/backup/venus/raspberrypi2/Backup_raspberrypi2_20231106_182638.img: Value too large for defined data type
It's clear that this comes from the line
BACKUP_FILES_TO_DELETE_COUNT=$(ls -tr ${BACKUP_PATH}/${BACKUP_NAME}* | head -n -${BACKUP_COUNT} | wc -l)
but I have no idea why.
Hello,
the script worked well (*) while backup (did it manual the first time), but I got an error:
ls: /mnt/backup/Venus/raspberrypi2/Backup_raspberrypi2_20240409_075209.img: Value too large for defined data type
As this is in the "delete old backups" of the script, I tried to run the "ls" manually and it gave the same result:
ls /mnt/backup/Venus/raspberrypi2/Backup_raspberrypi2_20240409_075209.img ls: /mnt/backup/Venus/raspberrypi2/Backup_raspberrypi2_20240409_075209.img: Value too large for defined data type
I am using Venus OS 3.22.
Do you have a suggestion ?
Thanks in advance
(*) log from the backup itself:
"
Creating Venus/ on backup mount...
Using script dd for backup.
15928000000 bytes (16 GB, 15 GiB) copied, 3424 s, 4.7 MB/s
15931+1 records in
15931+1 records out
15931539456 bytes (16 GB, 15 GiB) copied, 3446.6 s, 4.6 MB/s
Backup completed successfully.
"
Installed on Venus v 3.00~22
I edited backup.sh for the share
2023-06-07 05:26:31 (1.10 MB/s) - ‘/tmp/master.zip’ saved [92757]
Archive: /tmp/master.zip
creating: raspberry-pi-backup-master/
inflating: raspberry-pi-backup-master/LICENSE
inflating: raspberry-pi-backup-master/README.md
inflating: raspberry-pi-backup-master/install-backup.sh
creating: raspberry-pi-backup-master/raspberry-pi-backup/
inflating: raspberry-pi-backup-master/raspberry-pi-backup/backup.sh
creating: raspberry-pi-backup-master/raspberry-pi-backup/ext/
inflating: raspberry-pi-backup-master/raspberry-pi-backup/ext/dd
inflating: raspberry-pi-backup-master/raspberry-pi-backup/ext/mount.cifs
inflating: raspberry-pi-backup-master/raspberry-pi-backup/ext/mount.nfs
The installation was successful.
Now you have to change the default parameters of the script and setup a cronjob to run automatically "/data/etc/raspberry-pi-backup/backup.sh" on your desire.
root@raspberrypi2:~# /data/etc/raspberry-pi-backup/backup.sh
/sbin/mount.cifs: error while loading shared libraries: libcap-ng.so.0: cannot open shared object file: No such file or directory
mkdir: can't create directory '/mnt/backup/Backups/raspberrypi2': No such file or directory
/data/etc/raspberry-pi-backup/ext/dd: failed to open '/mnt/backup/Backups/raspberrypi2/Backup_raspberrypi2_20230607_053424.img': No such file or directory
ls: /mnt/backup/Backups/raspberrypi2/Backup_raspberrypi2*: No such file or directory
head: invalid number '-5'
umount: can't unmount /mnt/backup: Invalid argument
Dear Mr-Manuel,
I have used rpi-clone to clone my raspberry pi SD cards in the past, so that I can just pop in the cloned SD card if the original got corrupted. There is no need for an external computer in this scenario.
Rpi-clone will not work with Venus OS however, so I am very interested in your backup script. I see that your script is designed to create a backup on a remote computer. Can it be used instead to clone the SD card to another SD card located locally on USB? I think the path to the USB drive on Venus would be /run/media/sda1, but I am not sure this would work if your script is expecting a remote connection. Please advise.
Thank you in advance for the clarification.
P.S. I also use your dbus_serialbattery script on my system and it is awesome.
When I try to mount my CIFS-share I get the following error:
mount: /mnt: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount. helper program._
It looks like that the CIFS utils are not installed in VenusOS v3.12 large?
Hi,
thanks for developing this script, it's great.
I use it on two raspberry's. One with Venus OS and one with raspbian. On Venus OS it works great but on raspbian it deletes the backups it creates immediately after it finishes the creation a new backup. I have to set the backup_count to 0 to not delete all backups again.
Could you please have a look at this?
Hi mr-manuel
Tried to use your backup script on a raspberryPi 3B using VenusOS 3.00-32
The backup breaks up in the middle and I assume, that the share cannot be mounted as the script cannot unmount at the end. Having a look with df shows, that there is no mount.
root@PiVenusOS:/data/etc/raspberry-pi-backup# sudo ./backup.sh
117000000 bytes (117 MB, 112 MiB) copied, 11 s, 10.3 MB/s
/data/etc/raspberry-pi-backup/ext/dd: error writing '/mnt/backup/PiVenusOS/Backup_PiVenusOS_20230417_095734.img': No space left on device
122+0 records in
121+0 records out
121827328 bytes (122 MB, 116 MiB) copied, 12.0684 s, 10.1 MB/s
head: invalid number '-5'
umount: /mnt/backup: not mounted.
root@PiVenusOS:/data/etc/raspberry-pi-backup#
tried to mount the share manally, but didn't work either...
I got no error message, the mount command has no output.
This script worked earlier, when I used a lower version of VenusOS, but unfortunately not sure which version.
First of all, thank you very much for making this backup script available.
I am trying to back up active version of the Victron software running on Venus on a Raspberry Pi Zero 2 W.
For this I am connecting to the Pi using Putty.
However, when I run the ./backup.sh command I a problem occurs.
At first a file seems to be written to my NAS drive (on a QNAP server) but after a period of time usually > 30 seconds, I get a pop-up message that says "Network Error: Software caused connection abort".
On my file server a file is written, it can be of varying size - the last attempt it was 157,435 KB (but I've seen it up to about twice that size) .
I've checked the mount.nfs and mount.cifs files are in the sbin folder.
I've tried enabling SMB 1 when SMB 2 and 3 didn't work on the server.
However, same error each time.
Any help would be appreciated.
Thanks
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.