scheduling and removable storage?

Asked by kabanta

what is the model for how "back in time" handles scheduled
snapshots for removable storage?

as an example, if the snapshot schedule is set for "daily", WHEN
does that run? my main concern is that the daily snapshot may be
scheduled for a specific TIME, and if the target is removable
storage and it is not attached exactly at that moment, it may not
perform that day's backup.

Question information

Language:
English Edit question
Status:
Solved
For:
Back In Time Edit question
Assignee:
No assignee Edit question
Solved by:
kabanta
Solved:
Last query:
Last reply:
Revision history for this message
kabanta (knubee) said :
#1

i see this was answered in another question.

the solution is to schedule more frequent backups.

nonetheless, it would be good if "back in time" had a smarter way of handling removable storage -- and performing a "daily" backup even if the drive is not attached exactly when the chron job is run. (for example: checking whether a recent chron job failed because destination was not available, checking to see if it is now available, etc.)

Revision history for this message
Bart de Koning (bratdaking) said :
#2

In the next release we also implemented the solution to set your own backup hour.
We are also looking for a way to implement anacron to be more flexible in handling the time of backups, but that will take still a little longer...
But thanks for the idea anyway!

Cheers,
Bart

Revision history for this message
Steffen Neumann (sneumann) said :
#3

Hi,

I have just configured BiT for a Debian lenny system,
which has (still ?) the usbmount mechanism.
Hence I can trigger "backintime --backup"
via /etc/usbmount/mount.d/10_run_backintime,
see below. Make sure to replace the name_serial_partition string at its end,
which you can obtain from the /var/run/usbmount/<symlink>.
Also make sure the USB filesystem has a decent disklabel,
which you can use in the BiT target path /media/<disklabel>.

I have not (yet?) figured the equivalent mechanism for newer Ubuntu releases.

Actually this Debain lenny is a VDR system (video disc recorder),
so my user.callback sends messages to the TV,
see end of this comment.

Just wanted to share,
yours,
Steffen

cat /etc/usbmount/mount.d/10_run_backintime

#!/bin/sh
# This script creates the model name symlink in /var/run/usbmount.
# Copyright (C) 2005 Martin Dickopp
#
# This file is free software; the copyright holder gives unlimited
# permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
set -e

# Replace spaces with underscores, remove special characters in vendor
# and model name.
UM_VENDOR=`echo "$UM_VENDOR" | sed 's/ /_/g; s/[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._-]//g'`
UM_MODEL=`echo "$UM_MODEL" | sed 's/ /_/g; s/[^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._-]//g'`

# Exit if both vendor and model name are empty.
test -n "$UM_VENDOR" || test -n "$UM_MODEL" || exit 0

# Build symlink name.
if test -n "$UM_VENDOR" && test -n "$UM_MODEL"; then
    name="${UM_VENDOR}_$UM_MODEL"
else
    name="$UM_VENDOR$UM_MODEL"
fi

# Append partition number, if any, to the symlink name.
partition=`echo "$UM_DEVICE" | sed 's/^.*[^0123456789]\([0123456789]*\)/\1/'`
if test -n "$partition"; then
    name="${name}_$partition"
fi

## If that is *OUR* HD, run a backup
if test X"$name" = X"WDC_WD32_serial-number_partition" ; then
    /usr/bin/backintime --backup
fi

exit 0

cat ~/.config/backintime/user.callback
#!/bin/sh

case $1 in
 "1") svdrpsend MESG "Backup process begins"
        ;;
        "2") svdrpsend MESG "Backup process ends"
        ;;
 "3") svdrpsend MESG "A new snapshot was taken"
        ;;
        "4") svdrpsend MESG "There was an error: $2"
        ;;
 *) svdrpsend MESG "This should never happen !"
 ;;
esac