do shell script "gzip " & quoted form of POSIX path of itemToZip

Do shell scrip-command dont work. It always gives error, no matter how i tweak it. Thanks

tell application “Finder”
if exists “Macintosh HD:Users:Jack:.Trash:Something:” then
move “Macintosh HD:Users:Jack:.Trash:Something:” to “Macintosh HD:Users:Jack:Documents:BackUp:”
set rightNow to (do shell script “date +‘%y%m%d %H%M%S’” as string)
set name of folder “Macintosh HD:Users:Jack:Documents:BackUp:Something:” to rightNow & " someTextHere"
set itemToZip to “Macintosh HD:Users:Jack:Documents:BackUp:Something:” & rightNow & " someTextHere"
do shell script "gzip " & quoted form of POSIX path of itemToZip
end if
end tell

Hi cirno,

gzip does not support compressing directories by naming it’s path.
I haven’t tried but I think something like this should work:

do shell script "tar cvf - " & quoted form of POSIX path of itemToZip & " | gzip > " & quoted form of POSIX path of itemToZip & “.gz”

Or maybe you’d better use an other (easier to use) commandline archiver (zip, rar …)

:wink: D.

don’t know if this is your problem or not but.
what i normally do is use

tar -zcvf foldername.tar.gz foldername

that saves piping it through gzip when tar has that functionality built in.