#!/usr/bin/perl # filename: auto_update.pl # Auto update script. # author: Mika Ohtsuki (mika@mikamama.com) # ($Id: auto_update_pl.txt,v 1.1 2002/08/29 15:31:01 misty Exp $) # # cvs path $cvs = '/usr/bin/cvs -q'; $update = 'update -P -d'; $usage = "usage: auto_update.pl WORKDIR [MODE]"; # process arguments die $usage, "\n" unless $workdir = $ARGV[0]; $chmod = $ARGV[1] ? "; chmod -R $ARGV[1]" : ""; # main update process which must be execute in background. $cmd = "(cd $workdir; $cvs $update $chmod) &"; system($cmd); # last message. $date = `date`; chomp($date); $mesg = "$workdir automatically updated at $date"; print "$mesg\n";