undetected
undetected

Reputation: 77

Moving files from one folder to an archive folder in same remote directory

I am trying to move remote files from one folder to another but keep getting a failure error. Code:

$command = @("mv /specific/directory/path/source/* /specific/directory/path/destination", "ls //specific/directory/path/source")
$psftpPath = "local/path/to/psftp.exe"
$command |& $psftpPath -pw $password "$User@$Host" -be

Error

mv /user/specific/directory/path/source/file.extension /user/specific/directory/path/destination/file.extension: failure

The ls command does show all the right files in source

Upvotes: 0

Views: 126

Answers (1)

bahrep
bahrep

Reputation: 30662

The error Failure refers to status code 4 with the following common reasons:

Renaming a file to a name of already existing file.

Creating a directory that already exists.

Moving a remote file to a different filesystem (HDD).

Uploading a file to a full filesystem (HDD).

Exceeding a user disk quota.

I haven't tried your script, but I think that you can can follow the list above as a checklist.

Upvotes: 2

Related Questions