i'm trying to write a script that backs up my home directory, however i'm having trouble trying to exclude the hidden directories from the tar command.
These are the commands i've tried with no success:
Code:
tar -cvvf - ~root/ -X ~root/.*/ | gzip > backup.tar.gz
and
Code:
tar -cvvf - ~root/ --exclude=.*/ | gzip > backup.tar.gz
however the tar command is still include the hidden directories, is there way to stop hidden directories from being including in the tar command?
thanks,
jerry