#!/usr/bin/perl -w # rsync the given files and directories to lynx. use Getopt::Std; my %opts; getopts('hd:', \%opts); sub help{ print "rsync the given files and directories to lynx. USE: $0 [ -h | -d $dest | -- ] things_to_rsync The destination is lynx:\$\{HOME\}/public_html/$dest OPTIONS: -d An optional subdirectory of lynx:\$\{HOME\}/public_html -h Print this message. -- End of options, in case your file begins with -, but is not --. "; } if($opts{h}){ help(); exit 0; } if($#ARGV == -1){ help(); print STDERR "\n\nError: Need something to rsync!\n"; exit 1; } my $dest = "lynx:$ENV{HOME}/public_html"; if($opts{d}){ $dest .= "/$opts{d}"; } if(system("rsync -auvzP -e ssh @ARGV $dest")){ die "Error doing rsync -auvzP -e ssh @ARGV $dest"; } # Copyleft (C) 2004 Rob Reid.