How to copy a whole tree of files and directories?
Apart from using a filemanager (like e.g mc, ...) you can use the
following commands. All of them copy the current directory ("."),
including subdirectories, into a destination directory:
#!/bin/bash
tar czf /tmp/communigate.tgz /var/communigate
DAY=`date +'%A' `
mv -f /tmp/communigate.tgz /somewhere/$DAY.tgz
Run that from cron, probably not at 12:00 midnight, but 12:01 would be OK.
It can be a good idea to periodically check for bad blocks. This is done with the badblocks command. It outputs a list of the numbers of all bad blocks it can find. This list can be fed to fsck to be recorded in the filesystem data structures so that the operating system won't try to use the bad blocks for storing data. The following example will show how this could be done.
$ badblocks /dev/fd0H1440 1440 > bad-blocks $ fsck -t ext2 -l bad-blocks /dev/fd0H1440 Parallelizing fsck version 0.5a (5-Apr-94)If badblocks reports a block that was already used, e2fsck will try to move the block to another place. If the block was really bad, not just marginal, the contents of the file may be corrupted.
e2fsck 0.5a, 5-Apr-94 for EXT2 FS 0.5, 94/03/10
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Check reference counts.
Pass 5: Checking group summary information.
/dev/fd0H1440: ***** FILE SYSTEM WAS MODIFIED *****
/dev/fd0H1440: 11/360 files, 63/1440 blocks $
You must have an 1.44 MB bootable floppy-disk. Create an exact image of this floppy-disk by issuing the command
dd if=/dev/fd0 of=boot.img bs=18k
Place this floppy image into the directory holding the collection of your files (or into a subdirectory of it, just as you like). Tell mkisofs about this file with the option '-b' and also use '-c'. For details read the file README.eltorito in the mkisofs-distribution.
An interesting application for a custom bootable CD is as a virus safe DOS- or Windows-system. It saves you the money for the hard disks (if you have a network and use samba to put the user-data on a file server). The German computer magazine c't has a article about this issue in the issue 11/99, page 206 ( http://www.heise.de/ ).
Some details about the bootable RedHat CD-ROM is available from http://members.bellatlantic.net/~smithrod/rhjol-technical.html .