Page 1 of 1
Unzip files via sFTP command
Posted: Thu May 21, 2015 11:02 am
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
Re: Unzip files via sFTP command
Posted: Thu May 21, 2015 12:58 pm
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
Re: Unzip files via sFTP command
Posted: Thu May 21, 2015 5:51 pm
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