Backing up a workstation with dkopp

Dkopp is a backup utility for workstations used to copy or backup files to DVD.

INSTALLATION AND CONFIGURATION
1. Download the RPM. As root, install.

2. To run, “dkopp” as root. Help – Contents will open the user guide. What follows is adapted from it; refer to it for additional details.

3. Press “Edit Job”. The edit backup job window will open. Ensure that the DVD device and mount point match your system. In my case, the default settings of DVD device /dev/sr1 and mount point /media/cdrom were correct.

Select full backup and full verify.

Press “browse”, select a file/directory to be backed up. Use the “include” button to include all selected items in the backup job, and the “exclude” button to exclude items previously included at a higher level. You may also use the “include” button to include items previously excluded at a higher level. Use the “hidden” button to toggle the display of hidden files. Press the “done” button when finished selecting files.

Inspect the generated include and exclude statements. These may be edited directly if desired.

Press “save as” and save your job. A good place to save it is /root/.dkopp/jobfile, the default job file.

Press “done”. The edit backup job window will close and a report will display on the main screen. The last line will indicate if any errors were found; re-edit the job if needed.

Report – Get backup files. Wait for the report to generate and display and look for errors. Also ensure that Inspect the counts. Be sure the total byte count is within the DVD capacity. Re-edit the job if needed.

The error message “No such file or directory” sometimes indicates a problem, such as a lockfile in use or a dodgy filename. Sometimes, however, they can be ignored. Best practice is to investigate and correct any obvious problem, then check the output of the finished backup disk later.

Test your work: Press “run job”. DVD tray should load and backup should begin. Verification should follow automatically. Insure that no errors are reported.

Eject the DVD and insert it again. Insure that your system can read, that all intended files are there, and that files can be properly opened.

SET UP UNATTENDED BACKUP FOR CRON JOB
Create a script to run dkopp from a cron job. Mine is /root/.kdopp/jobfile_script, owner root, and is:

File > open job > /root/.dkopp/jobfile
File > run job
DVD > eject DVD
File > quit

Test it: Eject the DVD and insert it again. Wait for the drive to stop blinking, then run it from the command line to test: “dkopp -script /root/.dkopp/jobfile_script”. Check the terminal for error messages and the newly burnt backup for integrity.

Once tested, add the above command to a daily cron job.

You will probably want to also remove dkopp’s older history files, which otherwise will accumulate in /root/.dkopp.

I have the cron job /etc/cron.daily/backup.cron, which reads in part:

#!/bin/sh
# Back up hard disk to DVD with dkopp
dkopp -script /root/.dkopp/jobfile_script
# Remove dkopp history older than 30 days
find /root/.dkopp/ -name "dkopp-hist-*" -type f -mtime +30 -delete

Test it manually (as root, “/etc/cron.daily/backup.cron”) and ensure it works. Let it run via cron at its normal time and again insure it works.

RESTORE
Always restore from within dkopp, never copying directly from the DVD. Genisoimage, used by dkopp, does not preserve owner and permissions for directory files copied to DVD. To get around this, dkopp writes a special file to the DVD with the data needed for file restores.

Insert backup DVD and open dkopp. If you will be restoring files with permissions other than user, open as root. Select Restore – Setup DVD Restore. Click on “Browse” and find the directory(s) and/or file(s) to restore. In “copy-to disk”, indicate the destination for the restore. For example, to restore /var/www/html/* you would have:

  • copy-from: /var/www/html/
  • copy-to: /var/www/html/
  • include /var/www/html/*

The “copy-to” directory must exist and have appropriate ownership and permissions. Press “Done”. If there are no errors, select Restore – Restore Files.

NOTES
The RPM creates the file kornelix-dkopp.desktop in both /usr/local/share/dkopp/ and /usr/local/share/applications/, one or both of which should create a menu entry under “Accessories” or “Utilities” to launch dkopp as user. One or both can be edited if desired to launch dkopp as root using the form “gksu dkopp”.

dkopp-4.7.1 complained about missing wodim even though “which” sees it at /usr/bin/wodim. 4.7.1 also complained about missing udevinfo: some distros include that as part of the udev package, but Mandriva doesn’t. I cannot find a Mandriva package containing udevinfo on the mirrors or at rpm.pbone.net. Neither of these issues caused any problem, and no such messages have been seen in dkop-4.8.

Your job file can also be manually edited. A sample job file, perhaps named /root/.dkopp/jobfile, might be:

device /dev/sr1
mount /media/cdrom
dvdcap 4.0 0
backup full
verify full
datefrom 1970.01.01
include /home/USER/*
exclude /home/USER/tmp/*

REFERENCES
Dkopp project page

dkopp does not itself back up databases, but it can back up the .sql files produced by tools such as phpMyAdmin. Don’t forget to set up scheduled automatic backups of your databases.

About Warren Post

So far: Quality Assurance crash test dummy, jungle guide, tech support monkey, entrepreneur, IT consultant, teacher, beach bum, diplomat, over-enthusiastic cyclist.
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

1 Response to Backing up a workstation with dkopp

  1. Pingback: Backup and disaster recovery solutions for Linux | A maze of twisty little passages

Leave a comment