I can't get exclude to work right, I am pulling my hair out...
Code:
#!/bin/sh
DESTINATION="/home/user/backups/"
CACHE="/home/user/foo/var/cache/*"
tar -cvpzf ${DESTINATION} --exclude=${CACHE} ./*
What am I doing wrong here? It still tar's up the CACHE directory and subdirectories within var/cache.
Edit:
Nevermind I figured it out I needed to use "var/cache/*" instead of the full path because I was already planted in "/home/user/foo"
Like so:
Code:
#!/bin/sh
DESTINATION="/home/user/backups/"
CACHE="var/cache/*"
tar -cvpzf ${DESTINATION} --exclude=${CACHE} ./*