t-rex has asked for the wisdom of the Perl Monks concerning the following question:
Hi guys , I am transferring a file on remote host using openssh package using function scp_put(), the place where i intend to transfer this file has to be under certain directory which also should be created by us based on a uid/date. but it throws me error that transfer failed coz directory is not present on remote host. so how do i create this directory remotely.
for example : $sourcedir = "/tmp/xyz/test.tar"; $remotedir = "/tmp/some-dir/myfolder_uid_date/"; ssh->scp_put ( $sourcedir, $remotedir); or die "scp failed";
the output should be i should be able to transfer test.tar in the remote dir path, but i need to create this remote dir path on the fly or from host itself. how can i achieve this ? right now i get error no such file or directory /tmp/some-dir/myfolder_uid_date/
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: creating a directory remotely implicitly
by Corion (Patriarch) on Jun 28, 2016 at 13:22 UTC | |
by t-rex (Scribe) on Jun 28, 2016 at 13:46 UTC | |
by hippo (Archbishop) on Jun 28, 2016 at 13:50 UTC | |
by shmem (Chancellor) on Jun 28, 2016 at 13:52 UTC | |
Re: creating a directory remotely implicitly
by salva (Canon) on Jun 28, 2016 at 18:36 UTC | |
Re: creating a directory remotely implicitly
by perlfan (Parson) on Jun 28, 2016 at 14:12 UTC |