Great point. I did this because my other systems run windows and I can't simply write files to another host.
On 2/17/06, Graham S. Jarvis <[EMAIL PROTECTED]> wrote: > Hello All, > > This post reminded me to ask something I've been meaning to ask for a while. > . . > > Has anyone configured NFS and can post a working example? > It's supposed to be working since 0.2.6 (?) according to this post: > http://lists.kriscompanies.com/pipermail/astlinux-users/2005-April/000141.html > > Also, > Are there any plans for incorporating a Samba client in astlinux? > > Thanks for any info. > > -Graham S. Jarvis- > > ----- Original Message ----- > From: "Tom Lynn" <[EMAIL PROTECTED]> > To: "Discussion of AstLinux - Asterisk on Compact Flash" <[EMAIL PROTECTED]> > Sent: Sunday, February 19, 2006 8:42 PM > Subject: [Astlinux-users] perl script for moving recordings off AstLinux > > > If anybody is interested, I wrote a short perl script to move call > recordings off of my astlinux system. It checks to see if the last > modify time is greater than two minutes, assumes the recording is > complete, moves the file via ftp and then removes the file, saving > precious storage space on my keydisk. I run it from cron every > fifteen minutes. > > I've pasted it below. If anybody can suggest improvements, I'd love > to hear them. > > Thanks - Tom > =========================================================== > > #!/usr/bin/perl > > # Move MixMonitor recordings from the /var/spool/asterisk/monitor > directory to ftp host > # checks the last modification date of the files and moves them if > they haven't been modified > # for at least two minutes, in which case is should be safe to assume > they are closed. > # > # deletes files once they have been moved. > > use Net::FTP; > > my @files; > my $dev; > my $ino; > my $mode; > my $nlink; > my $uid; > my $gid; > my $rdev; > my $size; > my $atime; > my $mtime; > my $ctime; > my $blksize; > my $blocks; > > # open connection to ftp host > > $ftp = Net::FTP->new("192.168.1.11", Debug => 0) > or die "Cannot connect to 192.168.1.11: $@"; > > $ftp->login("anonymous",'-anonymous@') > or die "Cannot login ", $ftp->message; > > $ftp->binary; > > # change the working diretory to where the monitor files are stored > > chdir "/var/spool/asterisk/monitor" or die "\ncannot chdir to > /var/spool/asterisk: $!"; > > # get a list of filenames contained in the directory > > opendir DH, "/var/spool/asterisk/monitor" or die "\ncannot get > directory listing: $!\n\n"; > > @files = readdir DH; > > closedir DH; > > # look at the date and time of each file. If older than two minutes, > ftp to another server > > foreach (@files){ > if ($_ =~ /^\../) { # skip any files beginning with dot or dotdot > even thouth > # they're unlikely to have been created in the last two minutes > next; > } > > ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) > = stat $_; > if ((time - $mtime) > 120 ) { > $ftp->put($_); > unlink "$_"; > } > } > > $ftp->quit; > > _______________________________________________ > Astlinux-users mailing list > [email protected] > http://lists.kriscompanies.com/mailman/listinfo/astlinux-users > > Donations to support AstLinux are graciously accepted via PayPal to [EMAIL > PROTECTED] > > _______________________________________________ > Astlinux-users mailing list > [email protected] > http://lists.kriscompanies.com/mailman/listinfo/astlinux-users > > Donations to support AstLinux are graciously accepted via PayPal to [EMAIL > PROTECTED] > _______________________________________________ Astlinux-users mailing list [email protected] http://lists.kriscompanies.com/mailman/listinfo/astlinux-users Donations to support AstLinux are graciously accepted via PayPal to [EMAIL PROTECTED]
