#!/bin/sh BACKUPDIR=/path/to/drive/xchat2logs-$(date +'%Y%m%d') cd $HOME/.xchat2 tar cf - xchatlogs | ( cd $BACKUPDIR; tar xfp -)