Unzip files via sFTP command

Discuss RoboTask here
Post Reply
nuphero
Posts: 3
Joined: Thu May 21, 2015 10:34 am

Unzip files via sFTP command

Post by nuphero »

Hi, I want to upload and unzip a lot of .zip files using Robotask sFTP command action, but unzip command didn't work.

Code: Select all

[Actions\Action3]
ActionID=STRING|"A_SFTP_COMMAND"
Enabled=INTEGER|-1
Name=STRING|"SFTP command (unzip 1.zip)"
Params=FOLDER

[Actions\Action3\Params]
command=STRING|"unzip 1.zip"
But other commands like mkdir worked and it also worked when I tried unzip command on Putty. Could you please explain for me why unzip command did not work?

Thanks
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Unzip files via sFTP command

Post by Oleg »

unzip is not an internal command of sFTP
To run local command of server use ! :
!unzip 1.zip

available commands are:

Code: Select all

!      run a local command
bye    finish your SFTP session
cd     change your remote working directory
chmod  change file permissions and modes
close  finish your SFTP session but do not quit PSFTP
del    delete files on the remote server
dir    list remote files
exit   finish your SFTP session
get    download a file from the server to your local machine
help   give help
lcd    change local working directory
lpwd   print local working directory
ls     list remote files
mget   download multiple files at once
mkdir  create directories on the remote server
mput   upload multiple files at once
mv     move or rename file(s) on the remote server
open   connect to a host
put    upload a file from your local machine to the server
pwd    print your remote working directory
quit   finish your SFTP session
reget  continue downloading files
ren    move or rename file(s) on the remote server
reput  continue uploading files
rm     delete files on the remote server
rmdir  remove directories on the remote server
Oleg Yershov
nuphero
Posts: 3
Joined: Thu May 21, 2015 10:34 am

Re: Unzip files via sFTP command

Post by nuphero »

Thanks for quick reply,

I don't know much about Linux, and put ! like you said but it still does not work

Code: Select all

[Actions\Action4]
ActionID=STRING|"A_SFTP_COMMAND"
Enabled=INTEGER|-1
Name=STRING|"SFTP command (!unzip 1.zip)"
Params=FOLDER
I do not fully understand why, so I just use a small PHP script to do the unzip work.

Thanks for your time
Post Reply