PDA

View Full Version : How to automate a chmod command on many servers


filips
03-30-2013, 04:35 AM
Hi, I need to connect many servers, change remote path and then do chmod command on 3 files. I've been trying to do that for 2 hours and no success. Queue file can do only upload/download. Command line should do it, but it doesn't work. I'm trying:

"C:\Program Files (x86)\FlashFXP 4\flashfxp.exe" MyHost\mydomain.com -remotepath="/public_html" -raw="chmod 777 wp-content" -raw="chmod 777 .htaccess" -raw="chmod 777 wp-config.php"

I noticed it works only with 1 switch, but not more :(

Is it possible to automate my job?

bigstar
03-30-2013, 07:49 AM
On FTP servers to change the chmod you need to use SITE CHMOD <mode> <\path\name>

To do this you need to use one of the following:


Use a text file for the raw commands.

The command line would become
"C:\Program Files (x86)\FlashFXP 4\flashfxp.exe" MyHost\mydomain.com -raw="[raw.txt]"
The raw.txt file must be created in your FlashFXP data folder.
(location can be determined via FlashFXP > Help > About > Details).

the content of the raw.txt is one command per line.

SITE CHMOD 777 /public_html/wp-content/
SITE CHMOD 777 /public_html/.htaccess
SITE CHMOD 777 /public_html/wp-config.php



Execute the raw command using text content stored in the windows clipboard.

The command line would become
"C:\Program Files (x86)\FlashFXP 4\flashfxp.exe" MyHost\mydomain.com -raw="%c"

The clipboard content is interpreted as one command per line
The -remotepath switch is not valid in this context you need to provide the absolute path to the file or folder you want to perform the operation on.

filips
03-30-2013, 02:31 PM
Thanks. It works :)