gnu tar checkpoint variable expansion

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed Oct 21 13:55:44 UTC 2009


Jay Hall wrote:
> Ladies and Gentlemen,
> 
> I am working with gnu tar checkpoints this morning can cannot seem to 
> get variables to expand properly when they are passed as part of a 
> checkpoint action.  Following is how I am using gnu tar
> 
> DIR="/home/test"
> WHATTOBACKUP="/home/somedir"
> 
> /usr/local/gtar-1.22/bin/tar -cf - ${WHATTOBACKUP} \
>     --checkpoint-action='echo=Checkpoint #%u' 
> --checkpoint-action='exec=/usr/local/scripts/check_disk_usage.sh ${DIR}'
> 
> When I use ${DIR} as a parameter, it is not sent to the 
> check_disk_usage_script.  However, if I replace ${DIR} with /home/test, 
> everything works fine.
> 
> Any suggestions anyone has would be greatly appreciated.

That's fairly basic shell syntax.  Use "double quotes" on any string where
you want variable interpolation.

	Cheers,


	Matthew


-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20091021/14bf1744/signature.pgp


More information about the freebsd-questions mailing list