Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm using Bacula to backup to a disk file. The thing is, I'm backing up to an external USB disk and I want the backup to be robust to accidental unmounts of the external disk. Ideally, I would like to have the backup job stall if the disk isn't mounted (so it doesn't swamp the server's HDD) but resume when the disk is remounted.

I have accomplished the first objective by setting the backup directory to a specific directory on the external disk so that when the disk is unmounted, Bacula can't find it and the backup job gets stalled. When I remount the disk, however, the job fails to resume.

My current device definition in bacula-sd.conf:

Device{
  Name=Backups
  Media Type=File
  Archive Device = /mnt/backup/backups/ #Disk mounted on /mnt/backup
  Label Media = Yes;
  Random Access = Yes;
  Removable Media = No; # Otherwise, Bacula expects the backup volumes to already exist on disk
  Requires Mount = No; #Automounted via udev
  Always Open = No;
}

Is there a better way to ensure that the backup jobs will automatically resume when /mnt/backup is remounted?


Update

When I cancel the stalled backup job, the queued ones resume normally.

share|improve this question
    
I think this should work: when udev mounts the disk, pass the mount command to bconsole (echo whatever | bconsole). Plus, you can raise job concurrency on SD to avoid queue stalls. –  sendmoreinfo Jun 16 '13 at 19:48
    
@sendmoreinfo Do you mean pass the mount command from within the udev rule or manually? I'm hoping to do this with zero intervention. –  Joseph R. Jun 17 '13 at 16:17
1  
within udev rule, yes. –  sendmoreinfo Jun 17 '13 at 17:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.