Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating backup in target directory fails with systemd timer #81

Open
cmonty14 opened this issue Jul 5, 2020 · 7 comments
Open

Creating backup in target directory fails with systemd timer #81

cmonty14 opened this issue Jul 5, 2020 · 7 comments
Labels

Comments

@cmonty14
Copy link

cmonty14 commented Jul 5, 2020

Hi,

when I create the initial backup with snap-sync the tool asks for a directory. Here I typically use the hostname in order to identify different backups of multiple hosts.

No backups have been performed for 'root' on this disk.
Enter name of subvolume to store backups, relative to /backup (to be created if not existing): 

This directory is then created as a subvolume and the the backup of relevant subvolumes, e.g. root, home, etc. is started.
This all works fine and the result is this:

$ sudo btrfs su li /backup/
ID 257 gen 508 top level 5 path @backup
ID 437 gen 367 top level 257 path pc1-desktop
ID 438 gen 461 top level 437 path pc1-desktop/root/449/snapshot
ID 444 gen 480 top level 437 path pc1-desktop/home/1/snapshot

However, when I schedule a backup with systemd-timer using this systemd-config

[Unit]
Description=Run snap-sync backup

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/snap-sync --UUID de094dc0-58b7-4931-b948-4b920495bf94 --subvolid 257 --noconfirm

the backup is written to subvolume with ID=257 and a relevant directory root, home is created.

Problem:
How can I ensure that the automatic backup is written to the initially created directory pc1-desktop?

THX

@cmonty14 cmonty14 changed the title Creating backup in target directory fails with systemd Creating backup in target directory fails with systemd timer Jul 5, 2020
@cmonty14
Copy link
Author

cmonty14 commented Jul 7, 2020

snap-sync-root.txt
I have created a dump file for manual execution of snap-sync --UUID de094dc0-58b7-4931-b948-4b920495bf94 --subvolid 257

@wesbarnett
Copy link
Collaborator

Can you post the output of the following?

sudo snapper -c root list | grep "latest incremental backup"

@wesbarnett wesbarnett self-assigned this Jan 30, 2021
@FrankNoWar
Copy link

Having this problem too, seems that the $backupdir variable is not used when creating subsequent backups.

@wesbarnett
Copy link
Collaborator

Having this problem too, seems that the $backupdir variable is not used when creating subsequent backups.

@FrankNoWar can you give the output to the following?

sudo snapper -c root list | grep "latest incremental backup"

@FrankNoWar
Copy link

@wesbarnett I do not have a root config as my root volume is not btrfs, however here is the output for my home config.
sudo snapper -c home list | grep "latest incremental backup"

22  | single |       | dim 31 jan 2021 09:26:51 | root        |          | latest incremental backup | backupdir=francois, subvolid=5, uuid=17d18cf8-2fa4-40a6-ad7d-1cdf0a61d8ef

@wesbarnett
Copy link
Collaborator

Is this only with a timer or even when the command line is run? I can't seem to reproduce this.

@DerGeist
Copy link

I think the problem raises if the "used spaced" column is added to the table. This happened to me for one config of snapper but not for the other. awk is then selecting the wrong column. This does not happen if you add --disable-used-space

@wesbarnett wesbarnett removed their assignment Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants