This set of scripts was written by Jan-Pieter Cornet . The scripts are (C) Copyright XS4ALL, 1997. These scripts allow you to use amanda to backup a netapp "toaster", by using the dump command built into the netapp. This is version 0.1 of these scripts, the first version released to the internet. LICENSE & WARANTY None. I'm giving this away for free. Please make sure this README file accompanies the sources. There is no warranty, I cannot be held liable in case anything bad happens, including losing all data on the netapp, spontaneous combustion of the netapp, to powerfailures causing all the beer in your fridge to become really disgustingly warm. That said, I've used this for quite a while without noticable trouble. INSTALLATION Install these scripts on a machine that has the netapp mounted, and that has "rsh" access on that netapp. To save network bandwidth, if you only have one toaster, install this on the machine running the amanda driver (this prevents your data from crossing the network twice, once from the netapp via rsh to the scripts, once via amandad to the amanda driver). Currently these scripts use a lot of built-in constants. You will have to dive into the perl source and do some modifications if: - your toaster isn't called anything that matches "netapp*". - your toasters' / (root) directory isn't mounted in the root of your unix box using the same name for the mountpoint as the name of the box. - your dump doesn't live in /sbin - your perl in /usr/local/bin/perl isn't perl5 (I used perl5.004, I think perl 5.002 and above works, but haven't tested it) - the special snapshot you create for backups isn't called "snapshot_for_amanda" Install the supplied "dump" script as /sbin/dump, making sure your original dump is /sbin/_dump: # perform these shell commands in the directory this README is in mv /sbin/dump /sbin/_dump cp dump /sbin/dump Next, compile the setuidump executable from setuidump.c: make setuidump # if that failed, try: cc -O -s -o setuidump setuidump.c Make this setuid root and install in /sbin: cp setuidump /sbin # install group "operator" so only people in "operator" group can # use this command. See security note below. chown root.operator /sbin/setuidump chmod 4750 /sbin/setuidump Install setuidump.pl in /sbin: cp setuidump.pl /sbin Security note: I haven't studied the possible root holes in this setuidump script. I'm not aware of any, but I haven't carefully tested it either. You'd better not have untrusted users on the machine this runs on. At the very least everyone able to run the setuidump command is able to read all data on the filer. I suggest you use standard unix permissions to prevent this. Now, amanda sometimes requires that the device it's going to backup, actually exists. This script traps "dump" requests of devices /dev/netappname/path where "netappname" is the name of your netapp. For this discussion I'll assume the name of the toaster is simply "netapp". Suppose you're going to dump the /home and /etc directories on the netapp. To set this up, create devices /dev/netapp/home and /dev/netapp/etc on the unix. You can use the null device. For example: ls -l /dev/null crw-rw-rw- 1 root wheel 2,0,2 Oct 22 10:52 /dev/null # pay attention to ^^^^^ these numbers. You might also have 2 numbers # here instead of 3. mkdir /dev/netapp mknod /dev/netapp/home c 2 0 2 # the numbers appear here^^^^^ again, but space separated instead of # comma separated mknod /dev/netapp/etc c 2 0 2 # same here. Repeat for every path you want to backup If the file /tmp/dumpout exists, the scripts will write all STDERR output from dump here. It's probably a good idea to create it to see what dump commands have been used during a backup. Make sure it's writable by anyone: touch /tmp/dumpout chmod 666 /tmp/dumpout If you're no longer interested in debug output from dump, simply remove /tmp/dumpout and it won't be written. Amanda will try a lot of backups and abort them after the initialisation phase to determine the optimal schedule. It'll usually try a level 0, level 1 and level 2 dump, and note the tape usage of each. This causes a lot of dumps to be started. Each dump started will normally create a snapshot. Snapshot creation isn't that demanding, but it's better to be avoided. If the script detects a "snapshot_for_amanda", it'll use that to backup from. This saves you some time and some CPU resources. Simply create the snapshot from a crontab a few minutes before amanda starts. Put something like this in cron before amanda (say amanda starts at 2:00am, we start this at 1:55am every day) 55 1 * * * rsh netapp snap delete snapshot_for_amanda; rsh netapp snap create snapshot_for_amanda Note that it's *not* a good idea to use the automatic hourly.0 or daily.0 snapshots to backup from. If you do, and the snapshot is automatically renamed due to the snap schedule, either the dump aborts (newer netapps) or the entire filer crashes. USAGE Simply add devices of the form "netappname/path" to amanda's disklist, for the machine this is installed on, and that path on that netapp will be dumped to tape. The regular dump command will still operate as before (only STDERR will get logged in /tmp/dumpout if it exists). The "dump W" command is altered, the /etc/dumpdates file on the netapp is consulted and added to the output. The only dump commands available on /dev/netapp speudo-devices are: dump #sf ... - /dev/netapp/path Where # is the dump level, ... is the size argument (which is ignored). This is translated to: rsh netapp dump #f - /path dump #usf ... - /dev/netapp/path Again # is the dump level, size "..." is ignored. Results in: rsh netapp dump #uf - /path TESTING You could test it by issuing the command: dump 0usf x - /dev/netapp/etc > /tmp/netappetc0dump and see what output that generates. The same output should also appear in the /tmp/dumpout file, if that exists. If the command finishes, you should be able to read the generated dump using "restore ivf /tmp/netappetc0dump". Then try "dump W" and verify that the /dev/netapp/etc "device" is listed as having been backed up.