Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!usr/bin/perl -w use strict; use File::Find; use Filesys::SmbClientParser; my $smb = new Filesys::SmbClientParser (undef, ("User"=>$user, "Password"=>$pass, "Debug"=>1)); $smb->Host("hostname"); $smb->Share("share"); my @files; my @dir ('var/spool/asterisk/1/a'); find (sub { push @files, $_ if /\.mp3$/i}, @dir); find (sub { push @files, $_ if /\.wav$/i}, @dir); foreach my $content (@files) { $smb->get($content); $smb->cd('\\\\hostname\\share'); $smb->put($content); print "Moved file: " . $content . "\n"; } print "File move complete\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trying to move files from Linux to Windows using smbclient
by pmonk4ever (Friar) on Sep 16, 2009 at 19:51 UTC |