Simple CHMOD task

Discuss RoboTask here
Post Reply
davo
Posts: 3
Joined: Sat Jan 28, 2006 11:49 am

Simple CHMOD task

Post by davo »

Hi,I wish to be able to FTP in, CHMOD one directory to 777 and then log out.I will have for example say 50 cpanel accounts on the same server. I wish to make a task which can run through all these accounts and CHMOD the same directory in each of them one by one.Can you advise how to do this please?Thanks in advance,davo
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Simple CHMOD task

Post by Oleg »

You can do it by using FTP command action. See schema below.

FTP Logon
FTP Change folder //change to necessary folder
FTP Command //send CHMOD command
FTP Logout

You can repeat this operations within loop
davo
Posts: 3
Joined: Sat Jan 28, 2006 11:49 am

Simple CHMOD task

Post by davo »

Ho Oleg,

Thanks for the reply!

What would I exactly type in FTP Command to CHMOD?

How do I get it to loop through different Cpanel accounts?

Thanks in advance,

davo
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Simple CHMOD task

Post by Oleg »

See format details of chmod command in documentation for your FTP server. We are using Misrosoft FTP (IIS). The command chmod is included only into linux/unix FTP servers.

Format of chmod command is:
chmod [-R] <attrib> <Folder_Name>

-R switch tell to process all files and subfolders in specified folder (optional switch).

For example:
chmod 777 my_folder
davo
Posts: 3
Joined: Sat Jan 28, 2006 11:49 am

Simple CHMOD task

Post by davo »

Oleg thanks again.

I have the CHMOD working, but I have not idea how to use the loop function so I can loop through different cpanel accounts with this task.

Can you explain how to set that up please?

Thanks,

davo
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Simple CHMOD task

Post by Oleg »

See small example below. Save text of task into the file and use menu Task | Import to import one into RoboTask.
I think that you must connect as Root and change the folder attributes within text loop. In loop parameters you can enumerate all desired folders.

;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|565106205
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task375"
Hide=INTEGER|0
ID=INTEGER|1754644133
Name=STRING|"CHMOD by loop"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_FTP_LOGON"
Enabled=INTEGER|-1
Name=STRING|"FTP Log On"
Params=FOLDER

[Actions\Action1\Params]
anonymous=STRING|"0"
host=STRING|"ftp.company.com"
passive=STRING|"0"
password=STRING|"2489224938249382493824938"
port=STRING|"21"
username=STRING|"root"

[Actions\Action2]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER

[Actions\Action2\Params]
destvar=STRING|"C_FOLDER"
line0=STRING|"/pub/folder1"
line1=STRING|"/pub/folder2"
line2=STRING|"/pub/folder3"
line3=STRING|"/pub/folder4"
linecount=STRING|"4"
sourcetext=STRING|"1"

[Actions\Action3]
ActionID=STRING|"A_FTP_COMMAND"
Enabled=INTEGER|-1
Name=STRING|"FTP Command"
Params=FOLDER

[Actions\Action3\Params]
command=STRING|"chmod 777 {c_folder}"

[Actions\Action4]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action5]
ActionID=STRING|"A_FTP_LOGOFF"
Enabled=INTEGER|-1
Name=STRING|"FTP Log Off"
Post Reply