View Single Post
Old September 18th, 2013, 08:51 AM   #946 (permalink)
Sunny Vacation Supporter!
palmtree5's Avatar
Join Date: May 2012
Location: USA
Gender: Male
Posts: 3,730
Device(s): HTC One SV, Samsung Galaxy Prevail (retired), Nexus 7 (Gen 1)
Carrier: Boost Mobile

Thanks: 2,417
Thanked 2,204 Times in 1,160 Posts

Originally Posted by jonbanjo View Post
I don't get on well with bash (I dislike the syntax and there seems to me to be a number of "gotchas"). I guess if I had ambitions of being a system admin I'd have to change my ways but for me at home, I'd probably do something like.

PHP Code:
if (count ($argv) !=2){
"Usage zip.php directory\n";

if (!@
"Invalid directory\n";

$logfile "zip.log";
foreach (
glob("*"GLOB_ONLYDIR GLOB_MARK) as $dir){
$name basename($dir);
exec("zip -r \"$dir$\" \"$dir\" &>>$logfile");
There are other shells...
Find a post helpful? Hit
See spam or something offensive? Hit
New to the site? Site Rules/Guidelines and Introductions
Not a member yet but want to join? Join here!
Want to chat with staff?Here
Want to chat with mods?Here
palmtree5 is offline  
Reply With Quote