pjzero@90 has asked for the wisdom of the Perl Monks concerning the following question:
While trying to do this in a for loop:#system("/usr/bin/tmp",$output,"$USER\@$host:/tmp/LOGS/");
No luck..... Let's try this again, I do a ssh over to a host, and grab certain files from /tmp, this works fine, I then want to send these logs to a second host. my @OUTPUT = `ssh $USER\@$host ls -ltr /tmp | grep logs`; foreach my $output (@OUTPUT) { chomp ($output); system("/usr/bin/scp", "--", $output, "user\@host:/home/user/logs"; } I now get "No such file or directory", so your right, I need to put the log itself into a file, any ideas or should I use a different approach? Should I use "find"? Thanks, -- pjzero@90my @OUTPUT = `ls -ltr /tmp` foreach my $output (@OUTPUT) { chomp ($output); system("scp $output user@server:/tmp/LOGS"); } scp: illegal option -- w usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file +] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 [...] [[user@]host2:]file2 scp: illegal option -- w usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file +] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 [...] [[user@]host2:]file2 scp: illegal option -- w usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file +] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 [...] [[user@]host2:]file2 scp: illegal option -- w usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file +] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 [...] [[user@]host2:]file2 scp: illegal option -- w usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file +] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 [...] [[user@]host2:]file2 scp: illegal option -- w usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file +] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 [...] [[user@]host2:]file2 scp: illegal option -- w usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file +] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 [...] [[user@]host2:]file2
|
|---|