Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # upload the first image we come to in this path then delete the rest
- my $uri = "webcam.wunderground.com";
- my $uid = "(camname)";
- my $pw = "(password)";
- my $path = "/home/jrr/Pictures/sunsetcam";
- open(LOG, ">>$path/upload.log");
- my @files = <$path/*jpg>;
- my $any = 0;
- foreach my $f (@files)
- {
- if (!$any)
- {
- upload($f);
- $any = 1;
- }
- unlink($f);
- }
- sub upload
- {
- my ($f) = @_;
- my $cmd = "curl -T $f ftp://$uid:$pw\@$uri";
- print LOG "$cmd\n";
- system($cmd);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement