Need help with full backup

Hi.
Sorry for being a Linux noob.

I have installed the script at OSMC root and rsync too on my Vero4k.

When I try to run it with ’sudo ./osmc-backup’ it says:

This script needs pv but I can’t find it
Try: sudo apt-get install pv (or similar)

So i’m stuck.:no_mouth:

Hi,

Just installed pv (sudo apt-get install pv) and it installed with no issues. Try issuing sudo apt-get update and try installing again. If that doesn’t work, please provide some logs.

Thanks Tom.

Okey.
Installed: now it runs and fails sayin:

osmc@vero:~$ sudo ./osmc-backup
Sat Apr 18 14:15:22 CEST 2020 Backup version 0.1.12a
Going to back up to /192.168.1.12/NotreClaude/Vero/BackUps/2020-04-18 (unless I can’t find it).
media for /192.168.1.12/NotreClaude/Vero/BackUps
not mounted in /media or /mnt

I’ve followed the Mounting network shares with autofs (alternative to fstab) guide and can browse the content of the directory. But the script fails to locate it and I don’t see why.

Ok so you have to set the backup path to directory you’ve mounted the share. It should be under /mnt.

This is what i got in my auto.smb.shares file:

/mnt/192.168.1.12/NotreClaude/Vero/BackUps -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.1.12/NotreClaude/Vero/BackUps/

osmc@vero:/mnt$ ls gives:
192.168.1.12

and I can browse its content to the target directory “BackUps”…

Oops… I have to check something

There is no reason you can’t have an Ip address for the name of the mount folder, its just not standard (or recommended).

If it was me, I would do it like this:

auto.smb.shares:

/mnt/Backups -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.1.12/NotreClaude/Vero/BackUps/

Then in the backup script:

DEFAULTBACKUPDIR="/mnt/Backups"

Thanks Tom.

That’s it ! I finally made it thanks to you.

Now I just have to manage the cron thing.:sweat:

2 Likes

Sorry. Stupid question again.

Rsync is installed and Crontab as well.
Edited (crontab -e) and added

15 2 * * * root /home/osmc/osmc-backup >> /home/osmc/backlog

How can I test it?

Well the easiest to test is to change the 2 to the hour that is just coming up and check if it runs at a quarter past. If all is good you can change to 2 again

1 Like

Let me introduce myself: noob and dumb.

I changed it to 11h15 (local time):

15 11 * * * root /home/osmc/osmc-backup >> /home/osmc/backlog

but nothing happened.
“backlog” is a directory where the logfile if created? It’s empty.

It wouldn’t be a directory it would be a log file named backlog
What is sudo journalctl | grep 11:15 saying?

Also next check sudo journalctl | grep CRON

a lot…

Apr 20 11:15:01 vero CRON[29502]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 20 11:15:01 vero CRON[29509]: (root) CMD (root /home/osmc/osmc-backup >> /home/osmc/backlog)
Apr 20 11:15:01 vero CRON[29502]: (CRON) info (No MTA installed, discarding output)
Apr 20 11:15:01 vero CRON[29502]: pam_unix(cron:session): session closed for user root

Ok, so the Cronjob ran that’s good. So if there is nothing written in backlog my first test would be what is happening when you run sudo /home/osmc/osmc-backup from the commandline

Oh oh…

Mon Apr 20 12:07:29 CEST 2020 Backup version 0.1.12a
Going to back up to /mnt/Backups/2020-04-20 (unless I can’t find it).
looking for mounted media
media found at /mnt/Backups, accessed as autofs
1992979848 KiB available on drive
Counting and deleting backups older than 2019-04-21 or if more than 7 of them
Latest backup from 2020-04-19 kept
Now 1992979848 KiB available on drive
Going to stop mediacenter
Going to stop tvheadend
Failed to stop tvheadend.service: Unit tvheadend.service not loaded.
system is on /dev/vero-nand/root - copying from /
Backing up system partition to /mnt/Backups/2020-04-20/system
Counting files …
65745 files and directories to process
There are 1 previous backups
Found latest backup at /mnt/Backups/2020-04-19/system
Incremental backup: copying new and changed files to /mnt/Backups/2020-04-20/system
^C 0 0:00:17 [> ] 0% ETA 0:00:00
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at rsync.c(644) [sender=3.1.2]
Going to start mediacenter
rsync: [receiver] write error: Broken pipe (32)
rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at io.c(513) [receiver=3.1.2]
Going to start tvheadend
Failed to start tvheadend.service: Unit tvheadend.service not found.
rsync stopped while making incremental backup
rsync exited with status (0) see rsync(1) manpage for details.

So it works and has last time run yesterday?
Are your sure the logfile is empty?

What does ls -lah /home/osmc/backlog give you?

BTW, wasn’t that smart to interrupt the backup.

ls: cannot access ‘/home/osmc/backlog’: No such file or directory

Yes I made a full backup yesterday (manually by running the script).

BTW, wasn’t that smart to interrupt the backup.

Don’t get what you’re saying?

This is odd. Suggest to add 2>&1 at the end of the crontab line and let crontab run again in a couple of minutes.

Well I assume you interrupted the script by pressing Ctrl-c or did rsync sig-term for another reason?