Closed adhawkins closed 7 months ago
I have a partial answer for you. The --fast option suppresses the step where emborg asks borg for the repository size. In version 1.37 if you asked for --fast the previous repository size was kept. In version 1.38 the repository size is now deleted when you use --fast.
I'll keep looking to see why the create date is not being updated, but you might want to simply retry your backup without the --fast option. That might just fix everything. You don't want --fast anyway if you are tracking your respository size with borg-space. I should probably make a note of that in the borg-space documentation.
I have installed version 1.37, but cannot replicate your issue. Updating the latest file is the last thing the create command does. Can you check the logfile and look for 'updating date file for create' to see if it is attempting to update latest. Perhaps you can email me the logfile so I can take a look.
This is the log of a manually run create using the same options:
xcp-alpine-emborg:~/.local/share/emborg# cat vmbackup.log
emborg: version: 1.37 (2023-05-18)
emborg: invoked as: /usr/bin/emborg -c vmbackup create --fast --stats
emborg: log opened on Thursday, 23 November 2023 at 9:57:43 AM GMT.
reading: /root/.config/emborg/settings
reading: /root/.config/emborg/vmbackup
working directory: /
running command: create
staging run_before_backup[0] pre-backup script
running: borg \
'--version;' \
echo \
'emborg $(emborg --version);' \
echo \
'borg-space $(borg-space --version)'
exit status: 0
signaling start of backups to healthchecks.io: https://healthchecks.gently.org.uk:7000/ping/d15bf895-403d-4dca-8a19-024f02df2fdf/start.
Setting BORG_PASSPHRASE.
Borg-related environment variables: {
'BORG_PASSPHRASE': '<redacted>',
'BORG_DISPLAY_PASSPHRASE': 'no',
'BORG_RSH': 'ssh -4 -i /root/.ssh/id_emborg',
}
running in: /
Running Borg create command ...
running:
borg \
create \
--stats \
'<redacted>@<redacted>.repo.borgbase.com:repo::{now:%Y-%m-%d-%H-%M-%S}' \
/backups/vmbackup
starts at: 2023-11-23T09:57:45.283275+00:00
Unsetting BORG_PASSPHRASE.
ends at: 2023-11-23T09:57:54.494447+00:00
elapsed: 0:00:09.211172
Borg exit status: 0
staging run_after_backup[0] post-backup script
running: borg-space -r vmbackup --style compact
exit status: 0
staging run_after_backup[1] post-backup script
running: borg-space -g -S /var/www/localhost/htdocs/vmbackup.svg vmbackup
exit status: 0
signaling success of backups to healthchecks.io: https://healthchecks.gently.org.uk:7000/ping/d15bf895-403d-4dca-8a19-024f02df2fdf/0.
emborg: terminates with status 0.
emborg: log closed on Thursday, 23 November 2023 at 9:57:55 AM GMT.
No mention there of updating the date file as far as I can see. If I look at the previous log, it does include an entry for the prune and compact steps:
xcp-alpine-emborg:~/.local/share/emborg# cat vmbackup.log.prev
emborg: version: 1.37 (2023-05-18)
emborg: invoked as: /usr/bin/emborg -c vmbackup prune --list --stats
emborg: log opened on Thursday, 23 November 2023 at 6:16:51 AM GMT.
reading: /root/.config/emborg/settings
reading: /root/.config/emborg/vmbackup
working directory: /
running command: prune
Setting BORG_PASSPHRASE.
Borg-related environment variables: {
'BORG_PASSPHRASE': '<redacted>',
'BORG_DISPLAY_PASSPHRASE': 'no',
'BORG_RSH': 'ssh -4 -i /root/.ssh/id_emborg',
}
running in: /root/emborg-scripts
Running Borg prune command ...
running:
borg \
prune \
--stats \
--list \
--keep-daily 7 \
<redacted>@<redacted>.repo.borgbase.com:repo
starts at: 2023-11-23T06:16:51.040680+00:00
Unsetting BORG_PASSPHRASE.
ends at: 2023-11-23T06:23:12.003146+00:00
elapsed: 0:06:20.962466
Borg exit status: 0
updating date file for prune: /root/.local/share/emborg/vmbackup.latest.nt
Compacting repository ...
Setting BORG_PASSPHRASE.
Borg-related environment variables: {
'BORG_DISPLAY_PASSPHRASE': 'no',
'BORG_RSH': 'ssh -4 -i /root/.ssh/id_emborg',
'BORG_PASSPHRASE': '<redacted>',
}
running in: /root/emborg-scripts
running:
borg compact --threshold 1 <redacted>@<redacted>.repo.borgbase.com:repo
starts at: 2023-11-23T06:23:12.005517+00:00
Unsetting BORG_PASSPHRASE.
ends at: 2023-11-23T06:34:15.304062+00:00
elapsed: 0:11:03.298545
Borg exit status: 0
updating date file for compact: /root/.local/share/emborg/vmbackup.latest.nt
emborg: terminates with status 0.
emborg: log closed on Thursday, 23 November 2023 at 6:34:15 AM GMT.
This is the log of a run without --fast
xcp-alpine-emborg:~/.local/share/emborg# cat vmbackup.log
emborg: version: 1.37 (2023-05-18)
emborg: invoked as: /usr/bin/emborg -c vmbackup create --stats
emborg: log opened on Thursday, 23 November 2023 at 10:05:55 AM GMT.
reading: /root/.config/emborg/settings
reading: /root/.config/emborg/vmbackup
working directory: /
running command: create
staging run_before_backup[0] pre-backup script
running: borg \
'--version;' \
echo \
'emborg $(emborg --version);' \
echo \
'borg-space $(borg-space --version)'
exit status: 0
signaling start of backups to healthchecks.io: https://healthchecks.gently.org.uk:7000/ping/d15bf895-403d-4dca-8a19-024f02df2fdf/start.
Setting BORG_PASSPHRASE.
Borg-related environment variables: {
'BORG_PASSPHRASE': '<redacted>',
'BORG_DISPLAY_PASSPHRASE': 'no',
'BORG_RSH': 'ssh -4 -i /root/.ssh/id_emborg',
}
running in: /
Running Borg create command ...
running:
borg \
create \
--stats \
'<redacted>@<redacted>.repo.borgbase.com:repo::{now:%Y-%m-%d-%H-%M-%S}' \
/backups/vmbackup
starts at: 2023-11-23T10:05:56.353153+00:00
Unsetting BORG_PASSPHRASE.
ends at: 2023-11-23T10:06:05.534054+00:00
elapsed: 0:00:09.180901
Borg exit status: 0
staging run_after_backup[0] post-backup script
running: borg-space -r vmbackup --style compact
exit status: 0
staging run_after_backup[1] post-backup script
running: borg-space -g -S /var/www/localhost/htdocs/vmbackup.svg vmbackup
exit status: 0
signaling success of backups to healthchecks.io: https://healthchecks.gently.org.uk:7000/ping/d15bf895-403d-4dca-8a19-024f02df2fdf/0.
Setting BORG_PASSPHRASE.
Borg-related environment variables: {
'BORG_DISPLAY_PASSPHRASE': 'no',
'BORG_RSH': 'ssh -4 -i /root/.ssh/id_emborg',
'BORG_PASSPHRASE': '<redacted>',
}
running in: /root
running:
borg info --json <redacted>@<redacted>.repo.borgbase.com:repo
starts at: 2023-11-23T10:06:06.625902+00:00
Unsetting BORG_PASSPHRASE.
ends at: 2023-11-23T10:06:08.338131+00:00
elapsed: 0:00:01.712229
Borg exit status: 0
Borg stdout:
{
"cache": {
"path": "/root/.cache/borg/7c50729803423414cd223c0942868e8d1499861566648fd8ef78d3af9ecd2a07",
"stats": {
"total_chunks": 9607373,
"total_csize": 11134883924296,
"total_size": 21876082263446,
"total_unique_chunks": 874485,
"unique_csize": 1219575444743,
"unique_size": 2650884902527
}
},
"encryption": {
"mode": "repokey-blake2"
},
"repository": {
"id": "7c50729803423414cd223c0942868e8d1499861566648fd8ef78d3af9ecd2a07",
"last_modified": "2023-11-23T10:06:02.000000",
"location": "ssh://<redacted>@<redacted>.repo.borgbase.com/./repo"
},
"security_dir": "/root/.config/borg/security/7c50729803423414cd223c0942868e8d1499861566648fd8ef78d3af9ecd2a07"
}
updating date file for create: /root/.local/share/emborg/vmbackup.latest.nt
emborg: terminates with status 0.
emborg: log closed on Thursday, 23 November 2023 at 10:06:08 AM GMT.
As you can see, that one does update the create date, after running borg --info
I can't remember why I decided to run with --fast
. What does this flag do?
A bit more info. My settings
file contains these:
prune_after_create = False
check_after_create = False
Could it be related to this?
Okay, I found the issue. I don't know why I did not see this earlier. My git foo failed me.
This is a bug in version 1.37. If you use the --fast option the latest file is not updated. The way to resolve this is to update to 1.38.
In your case the use if --fast does not really help you at all. --fast tells the create command to skip any configured prune, compact, and check operations in order to do a quick backup. But you have not configured a prune or check to run after the create, so --fast is largely a no-op for you.
Glad I could help you track it down.
I'll remove the '--fast' from my scripts. I was coming to the same conclusion as you that it was un-necessary as I have check / prune disabled in the config anyway.
Current emborg version installed:
I realise there's a newer version, but I need to schedule this in to coincide with the borg update that requires potential repository maintenance when upgrading.
I run emborg daily to back up a number of different locations. I receive emails showing that these daily backups are taking place.
However, in
vmbackup.latest.nt
I see:The
due
command seems to reflect these entries:However, if I list mybackups:
The backup is run using:
In this case,
$config
would bevmbackup
.It would appear that the value for
repository size
also isn't being updated, as the history for this records the same value since the last logged backup (in/root/.local/share/borg-space/vmbackup@x cp-alpine-emborg~root.nt
):Am I doing something wrong?