On 2019-11-22 04:41, Bernhard wrote: > However, I am stuck on how to determine how many days it has actually >>>> been since the last backup. >>> >>> What you are looking for is this command: >>> >>> qvm-prefs --get $vm backup_timestamp > > Nice. In case of a "manual backup", can you also set the variable that > way? Like > > qvm-prefs --set $vm backup_timestamp 2019.11.22-00:00:00 > > (or some other time format) ? >
I believe it requires the Unix timestamp as a long int, but represented as a string, so you would need to first convert your string to the Unix long int representation. The example command below is untested, but this should work to set the backup_timestamp to the time value of some archive file taken from some other non-qubes backup solution. $ backup_timestamp=`date --reference=/path/to/my_backup.tgz +%s` $ qvm-prefs --set $vm backup_timestamp $backup_timestamp Or like you asked, you can just use the date command to convert any standard time format string to the required unix timestamp value. If you are using the qvm-backuprestore command like I am, then this is always done for you for free, and you need not worry about managing the backup timestamps yourself. As a part of my backup script I also need to deal with freeing up enough removable disk space for the pending backup session. My backup target disk is managed as a set of folders, one per VM, and based on the predicted backup size I roll though all the VM folders, sort that vm's backup directory based on time, and remove only however many old backup archive files from each directory that I need in order to free up that required amount of space. This way I am guaranteed to have at least N backups of each VM and only the older archives are removed as newer ones are created. Its a great feature that Qubes keeps tabs on the previous backup timestamps in its VM database. That makes the complexity of custom backups easy to manage using very simple bash/python scripting. Steve -- You received this message because you are subscribed to the Google Groups "qubes-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to qubes-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/c426f037-095d-c90f-6fec-4dfb14c90fbc%40jhuapl.edu.