Re: gnu tar checkpoint variable expansion
Try this: /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} The use of single quotes prohibits the expansion of environment variables. Use double qoutes instead. Thanks Trond, this did the trick. Jay ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: gnu tar checkpoint variable expansion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 21 Oct 2009 08:44-0500, Jay Hall wrote: [...] 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}' Try this: /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} The use of single quotes prohibits the expansion of environment variables. Use double qoutes instead. - -- - -- Trond Endrestøl | trond.endres...@fagskolen.gjovik.no ACM, NAS, NUUG, SAGE, USENIX |FreeBSD 7.2-STABLE Alpine 2.00 -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkrfEg8ACgkQbYWZalUoEltZnACggXsvYV1wq/91nSUabiLEhuBt 9qIAn1FN+EqFu4IdNhQbB9Y5IMtJtnGq =myOf -END PGP SIGNATURE-___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: gnu tar checkpoint variable expansion
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 signature.asc Description: OpenPGP digital signature
Re: gnu tar checkpoint variable expansion
On Oct 21, 2009, at 8:55 AM, Matthew Seaman wrote: That's fairly basic shell syntax. Use double quotes on any string where you want variable interpolation. Cheers, Matthew I will try that again and let you know what happens. Thanks, Jay ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org