ftp / chmod ?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

ftp / chmod ?

Post by matthiasR » Tue Aug 30, 2005 3:16 pm

Hi,

i need to change the accessright on a ftp server with chmod. Can this be done by MacroScheduler?

Matthias

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Aug 30, 2005 3:57 pm

Assuming you're going to telnet into the server, you can use the Send Character/Text (abbreviated send) function to enter any unix commands that you would otherwise type at the unix command line. I would put a healthy "wait" between each "send" to make sure the command was executed. And you must also use "press Enter" after each "send" to execute the command.

For example:

//do something
Set Focus>Telnet*
send>chmod 554 /home/users/myname/myfile
Wait>1
Press Enter
Wait>1
//do something else

You could also use MS to do the login portion of the telnet using the "Run Program" function to start telnet then use "send" and "press enter" to enter the username and password.


Hope this helps,
Dick

matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

Post by matthiasR » Tue Aug 30, 2005 4:06 pm

thanks. But this will not work, as i have no telnet access to the server.

I have just ftp-access. )With a FTP-program like WSFTP pro i can change the attributes. )

But i have to change it by script.


Matthias

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Aug 30, 2005 4:21 pm

Sorry, I'm not familiar with the program you mention. My experience with FTP is mostly using the command line and I'm not aware of being able to use chmod in a command line within FTP.

Maybe someone else will have a solution for you.

Dick

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Aug 30, 2005 4:29 pm

Create a text file that looks like this:

username
password
cd /put/path/here/if/required/
quote SITE chmod 755 flename
quit

Save this file somewhere. For this example we'll call it chmod.ftp

Now in Macro Scheduler do this:

Let>RP_WAIT=1
Run>ftp -s:c:\path\chmod.ftp someserver.com

Replace someserver.com with the server name or IP address you are connecting to. Change path to reflect the path you saved chmod.ftp to. Modify the ftp command file as required.
MJT Net Support
[email protected]

User avatar
JRL
Automation Wizard
Posts: 3505
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Aug 30, 2005 4:30 pm

OK, another thought. Can you use Internet Explorer to access your FTP server? If you can, if you right click on a file and go to "Properties" on the popup menu, does it give you a permissions window? If this all works then this could be automated through MS using appropriate mouse clicks and/or keystrokes. Perhaps this is even similar to your FTP software?

Later,
Dick

matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

Post by matthiasR » Tue Aug 30, 2005 7:00 pm

Thanks to both of you.

I tried it, like support suggested. And it works :-)


Thank you very much.


Matthias

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts