elkarbackup icon indicating copy to clipboard operation
elkarbackup copied to clipboard

snapshot_root needs to be defined before backup points

Open dml33 opened this issue 4 years ago • 5 comments
trafficstars

Hi.

I am using: Elkarbackup version: 2.1.0 OS: Debian Buster 10.8

I am trying to run a job, but an error ocurs every time:

image

[2021-09-05T15:43:08] /usr/bin/rsnapshot -c /tmp/rsnapshot.1_4.cfg sync: ERROR: /tmp/rsnapshot.1_4.cfg on line 191:
[2021-09-05T15:43:08] /usr/bin/rsnapshot -c /tmp/rsnapshot.1_4.cfg sync: ERROR: backup \
         [email protected]:/mnt/pool1/Cloud/NC-DATA/NC-DATA/mine/files \
         . - snapshot_root needs to be defined before backup points 
[2021-09-05T15:43:08] /usr/bin/rsnapshot -c /tmp/rsnapshot.1_4.cfg sync: ERROR: ---------------------------------------------------------------------
[2021-09-05T15:43:08] /usr/bin/rsnapshot -c /tmp/rsnapshot.1_4.cfg sync: ERROR: Errors were found in /tmp/rsnapshot.1_4.cfg,
[2021-09-05T15:43:08] /usr/bin/rsnapshot -c /tmp/rsnapshot.1_4.cfg sync: ERROR: rsnapshot can not continue. If you think an entry looks right, make
[2021-09-05T15:43:08] /usr/bin/rsnapshot -c /tmp/rsnapshot.1_4.cfg sync: ERROR: sure you don't have spaces where only tabs should be.

I have catched the config file in /tmp and it is this way:

rsnapshot.1_4.cfg

But, if I run it manually from a shell this way, it works perfectly:

sudo rsnapshot -V -c rsnapshot.1_4.cfg sync

What could be the reason?

dml33 avatar Sep 05 '21 17:09 dml33

I see your snapshot_root is a mounted volume. It could be a permission issue. Did you try the rsnapshot command as elkarbackup user?

su - elkarbackup
sudo rsnapshot -V -c rsnapshot.1_4.cfg sync

xezpeleta avatar Sep 06 '21 06:09 xezpeleta

Hi.

If I run it with sudo, it works perfectly:

pi@raspberrypi:~ $ sudo rsnapshot -V -c rsnapshot.1_4.cfg sync
Setting locale to POSIX "C"
echo 1687 > /tmp/rsnapshot.0001_0004.pid
/usr/bin/rsync -av --delete --numeric-ids --relative --delete-excluded \
    --stats --rsh=/usr/bin/ssh -o BatchMode=yes -o StrictHostKeyChecking=no \
    [email protected]:/mnt/pool1/Cloud/NC-DATA/NC-DATA/mine/files \
    /mnt/poolUSB/backups/0001/0004/.sync/.
receiving incremental file list

[...]

Number of files: 11,427 (reg: 10,576, dir: 851)
Number of created files: 2 (reg: 2)
Number of deleted files: 0
Number of regular files transferred: 2
Total file size: 26,348,011,209 bytes
Total transferred file size: 1,282,990 bytes
Literal data: 1,282,990 bytes
Matched data: 0 bytes
File list size: 61,191
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 996
Total bytes received: 1,555,142

sent 996 bytes  received 1,555,142 bytes  54,601.33 bytes/sec
total size is 26,348,011,209  speedup is 16,931.67
touch /mnt/poolUSB/backups/0001/0004/.sync/
rm -f /tmp/rsnapshot.0001_0004.pid
/usr/bin/logger -p user.info -t rsnapshot[1687] /usr/bin/rsnapshot -V -c \
    rsnaphost_config_job4.cfg sync: completed successfully

Another thing is that I cannot see the config file, as stated in the FAQ:

Is there a way to see the generated rsnapshot configuration file?
Yes. Add "config" in your Job URL: http://myelkarbackup/client/1/job/1/config

image

I captured the file by doing:

cat /tmp/rsnapshot.1_4.cfg

and later copying it to to a file

Any ideas?

Thanks!

dml33 avatar Sep 06 '21 13:09 dml33

Hi. Anything I could try or any more information to give? Thanks

dml33 avatar Sep 25 '21 16:09 dml33

Hi. Is there any news about this issue? It still happens to me. I cannot run successfully the jobs from the GUI. They always fail with the same error above mentioned. Thanks!

dml33 avatar Feb 09 '22 20:02 dml33

Well, I think I solved it.

I had to change the user who triggers the cron job from elkarbackup to root, in order to preserve the ownership and permissions of the copied files:

total 16
drwxr-xr-x 3 root        root        3 ene 14  2021 Daily.4
drwxr-xr-x 3 root        root        3 ene 26  2021 Daily.3
drwxr-xr-x 3 root        root        3 feb  7  2021 Daily.2
drwxr-xr-x 3 root        root        3 ago  1  2021 Daily.1
drwxr-xr-x 6 elkarbackup elkarbackup 6 feb  9 21:48 ..
drwxr-xr-x 3 root        root        3 feb  9 21:58 .sync
drwxr-xr-x 3 root        root        3 feb  9 21:58 Daily.0
drwxr-xr-x 8 root        root        8 feb  9 21:58 .

The modified crontab:

pi@raspberrypi:~ $ cat /etc/cron.d/elkarbackup
* * * * *               root    /usr/share/elkarbackup/bin/console elkarbackup:tick
0 0 * * 1               elkarbackup     /usr/share/elkarbackup/app/console tahoe:renew_leases

dml33 avatar Feb 09 '22 21:02 dml33