Several weeks ago I sent in a small patch which would allow a user to
queue a PC (allowing BackupPC to decide whether or not a backup needs
to be done). I found it to be inadequate and it had some bugs.
Attached is a patch which resolves these. In addition to abstracting
the queueing process (by creating a subroutine to add a host to a
queue), this patch also allows you to queue a host through the server
message protocol. It does so by expanding the functionality of the
"backup" message. Instead of indicating incremental or full (0 or 1),
you can pass it:
doIncr : do an incremental backup now
doFull : do a full backup now
auto : let BackupPC decide whether a backup needs to be done (ie, just
add the host to the queue)
autoIncr : same as "auto" but if a backup is needed only do an
incremental (but a full dump will be done if no dumps have succeeded)
autoFull : same as "auto" but if a backup is needed only do a full
(For backwards compatibility, 0 still means doIncr and 1 still means doFull.)
This additional functionality required two more options to BackupPC_dump:
-I : if a dump is needed, only do an incremental (but a full dump will
be done if no dumps have succeeded)
-F : if a dump is needed, only do a full dump
I have been using the patched version in a production environment for
the past 7 days without any problems.
As a side note, I believe there is a bug in 3.1.0 (and possibly
earlier) which is fixed by this patch. In BackupPC::QueueAllPCs() a
DHCP IP address would be queued without checking if the disk is full.
This patch will check disk usage before adding any host to any queue.
I'd appreciate any comments or suggestions. If anybody is curious,
the impetus for this was the need to backup a PC which is frequently
off-site, but still needs to be backed up. When off-site, I will
queue it with "onlyIncr" to save time and network traffic. The
backups will be done using OpenSSH's remote port forwarding (-R).
Get latest updates about Open Source Projects, Conferences and News.