Linux Oneliners

  • create a simple backup
  • dd if=/dev/hda1 | gzip -c | split -b 2000m - /somewhere/backup.img.gz.
    
    We read the raw disk device (/dev/hda1) and pipe it through gzip for compression.
    split takes care of limiting the output files to 2GB (just to keep things manageble).
    restore with:
    cat /somewhere/backup.img.gz.* | gzip -dc | dd of=/dev/hda1
    

  • process queued mail from the sendmail directory /var/spool/clientmqueue
  • /usr/lib/sendmail -L sm-msp-queue -Ac -v -q
    
    Sometimes you find out that sendmail is not processing your sent email and everything is still sitting in de client mailqueue directory. With the above command you can then send out all pending email in one go.
    last edit: 20071209
    back to: www.oiepoie.nl