Exclude directories when backing up with 'tar'?
Just got my first proper server running - debian woody with the 2.4.18 kernel - doing print & file serving, but having problems doing a basic system backup.
I've been trying to use 'tar' to backup the base system files from the root partition (hda1) to a partition on another drive (sda1) but cant figure out how to use the 'exclude' option.
I've tried using --exclude [filename] in various places, but it does not seem to work. Anyone point me to an idiots guide to the syntax for this? I just want to exclude /dev /tmp /mnt /proc /lost+found & so on from the backup.
I've tried: (having first mounted sda1 & cd'd to it)
tar cvf backup.tar --exclude=/mnt --exclude=/dev --exclude=/proc /
tar --exclude=/mnt --exclude=/dev --exclude=/proc cvf backup.tar /
tar cvf backup.tar / --exclude=/mnt --exclude=/dev --exclude=/proc
but none work - where exactly do i put the 'exclude' command??