SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
rsnapshot pre script for crypted usb har
Author Message
Post rsnapshot pre script for crypted usb har 
Hi,

I am usind Debian 4.0 (Etch) and rsnapshot 1.2.9 (Debian) and want to
backup on a external, crypted USB harddisk.

For this I tried the pre and post script feaure of rsnapshot to unlock,
mount, backup (rsnapshot), unmount, lock the harddisk.

The problem is that this combination doesn't work with the pre and post
scripts.

Example:

laptop:~# rsnapshot -v -t -c /etc/rsnapshot_hdd.conf backup
echo 30700 > /var/run/rsnapshot_hdd.pid
mkdir -m 0700 -p /mnt/backup_hdd/rsnapshot/laptop/
/home/rsnapshot/rsnapshot_hdd_pre.sh
mkdir -m 0755 -p /mnt/backup_hdd/rsnapshot/laptop/backup.0/
/usr/bin/rsync -a --delete --numeric-ids --relative
--delete-excluded /etc \
/mnt/backup_hdd/rsnapshot/laptop/backup.0/laptop/
touch /mnt/backup_hdd/rsnapshot/laptop/backup.0/
/home/rsnapshot/rsnapshot_hdd_post.sh

Why is the pre script executed after the directory creation?
It is only a "beauty" problem but so the dir is created on the unmounted
device.
If I don't create the dir on the unlocked, mounted usb harddisk this can
lead to an error/problem I think.
A nice addon feature is, if the pre script is executed first, you can
put the logfile also on the crypted usb harddisk to store it in a save
place.

Using the no_create_root 1 feature doesn't solve the problem. I get this
error.

laptop:~# rsnapshot -v -t -c /etc/rsnapshot_hdd.conf backup
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these
options:
/usr/bin/rsnapshot -v -t -c /etc/rsnapshot_hdd.conf backup
----------------------------------------------------------------------------
ERROR: /mnt/backup_hdd/rsnapshot/laptop does not exist.
ERROR: rsnapshot refuses to create snapshot_root when no_create_root is
enabled


I think it is possible to unlock and mount the harddisk with a own
script and let then execute rsnapshot by this script.

But it would be better when a pre script in rsnapshot is executed before
every other task that rsnapshot do. So it is a real pre script.

I am open for your arguments and help about my problem. Maybe someone
else has a similar backup running and give some advice.

By the way. I love rsnapshot. It is my favourite backup tool.


Here are my pre and post scripts.

rsnapshot_hdd_pre.sh

#!/bin/bash

cryptsetup luksOpen /dev/sdb1 backup_hdd
--key-file /home/rsnapshot/backup_hdd.key
sleep 5s
mount /dev/mapper/backup_hdd /mnt/backup_hdd
sleep 2s
exit 0


rsnapshot_hdd_post.sh

#!/bin/bash

umount /dev/mapper/backup_hdd
sleep 2s
cryptsetup luksClose backup_hdd
exit 0


Best regards

Dominik

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Post rsnapshot pre script for crypted usb har 
Hallo, Dominik,

Du (dominik) meintest am 28.07.07:


For this I tried the pre and post script feaure of rsnapshot to
unlock, mount, backup (rsnapshot), unmount, lock the harddisk.

[...]

I think it is possible to unlock and mount the harddisk with a own
script and let then execute rsnapshot by this script.

I prefer this way.

But it would be better when a pre script in rsnapshot is executed
before every other task that rsnapshot do. So it is a real pre
script.

How will you manage the case "no target found"?

Viele Gruesse!
Helmut

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB