Giter Site home page Giter Site logo

raspibackup's Introduction

Hi, I’m @dolorosus

This repository is my private playground. Meant as my storage accessible from everywhere. Here you can find some of my daily used scripts for backup (Raspi and Cubox) with the wrappers for backup versioning.

Questions, wishes and suggestions are always welcome

Languages and Tools:

Visual Studio Code

Git

GitHub

Terminal

Terminal

GitHub

raspibackup's People

Contributors

dolorosus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

raspibackup's Issues

Should exclude /boot from rootfs rsync?

Had this thought just now... shouldn't /boot be excluded by the rsync command on rootfs? Wouldn't it otherwise create a duplicate of the boot partition inside an unmounted target folder? Or otherwise... for reasons?

Stopping docker

Is it safe just to stop docker or should I do 'docker-compose down' before? How do you @dolorosus do it?

Thank You!

Tweaking rsync excludes

As per this you might want to add
var/cache/apt/archives/
in the excludes, and also change
home/pi/.cache/
to
home/${USERNAME}/.cache/
and define that parameter by default in the beginning of the script (most users will have totally removed user 'pi', and will have a single folder under /home/, which you can take the username from, and then maybe add a optarg to commandline to specify that... but maybe it would be overkill

crontab item doesn’t start

Hello, I always used this great script and restored my Rpi three times with it.

I never managed to get crontab working tough…

sudo bash /home/pi/RaspiBackup/RaspiBackup.sh start -i /dev/sdb -s 15000 -c /media/pi/Time\ Capsule/RaspiBackup/RaspiBackup$(date +%d-%m-%Y).img

this command works successfully when manually executed, but crontab never execs it (I even tried to run it each half an hour, nothing happens)

Device name determination is wrong for anything not mmcblk0

Ok now you'll be blocking me for flooding 😈

This:

lsblk: /dev/sdbp1: not a block device
Could not find PARTUUID of /dev/sdbp1
Changeing PARTUUID from  to b198590c-01 in /tmp/fstab
lsblk: /dev/sdbp2: not a block device
Could not find PARTUUID of /dev/sdbp2
Changeing PARTUUID from  to b198590c-02 in /tmp/fstab
fstab cannot be changed automatically.
correct fstab on destination manually.

I don't think this changes anything about the backup condition, but rather you would need to factor in the device path to form the partition path, like the issue I opened in lzkelley's repo.
So "p1" and "p2" for /dev/mmcblk0, "1" and "2" for /dev/sdX, and "-part1" and "-part2" for the, conceptually preferable, /dev/disk/by-id/blahblah

FR: 7zip compression (along gzip?)

adding the ability to deal with 7zip compression for those backups running during the night, were the long compression task isn't a problem, might be a nice idea, especially if combined with cloud uploading.
A few more lines of code could deal with installing p7zip-full (needed for the 7z command) if missing.

Feature request: dynamic determination of boot and root partition

Ok, I promise this is the last issue I open (for today).

I have this non problem, where even after correcting the ${SUFFIX} in the partuuid determination, my boot partition is not on the same device where root resides (raspi4 with no support for USB boot, so /boot is on SD and / on pendrive).
That's where I thought, why should you even specify the source device by hand, when it's not the SD?
Since fstab is there to help, you could extract boot's and root's PARTUUID from fstab, compare that to the output of blkid, and then rsync the relevant partitions to the image.
This would make for a very flexible tool.
There would be a catch when /boot resides on SD and / on pendrive, because after flashing the backup image there could be an inconsistency with the PARTUUID declared in the /boot row of fstab, but that can be easily corrected by hand by anyone who's skilled enough to run a system from SD+USB.

Error with do_umount() invocation

Anyway I try to start the backup (I first tried with the commandline I was using with lzkelley's build) I always get:

sudo ./backup start -ci /dev/sdb -s 4000  /media/giant/_PiBackup/$(uname -n)-$(date +%Y-%m-%d).img
./backup: line 321: syntax error near unexpected token `>'
./backup: line 321: `   do_umount() 

I tried with the basic sintax:
sudo ./backup start -c /media/giant/_PiBackup/test.img
but that doesn't solve it

If I comment like so:
do_umount() # > /dev/null 2>&1'
I then get

./backup: line 322: syntax error near unexpected token `truncate'
./backup: line 322: `   truncate --size=+1G "${IMAGE}"'

and at this point I'm pretty lost since I cannot reverse engineer the code right now :smile: 

FR: cloud upload

Comes after 7zip compression, for obvious reasons.
There is already a github repo of a stable dropbox uploader, which I use for my bazidrop repo, and I remember seeing somewhere similar tools for mega.

FR: fstab inconsistecy detection for SD/USB combined installs

The script should detect when the cmdline.txt contains a PARTUUID different from the actual partuuid of rootfs, which could mean that /etc/fstab was not updated with the correct PARTUUID for boot.
It could give both false positives and false negatives, but it's still something relatively easy to do, and useful to have.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.