egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is posible?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat May 07, 2016 4:42 pm    Post subject: Reply with quote

juanamores wrote:

...
But , not upload nothing ....
...
Any suggestions ?


This works for me. Runs once daily, via crontab:

Code:

ftp -n -v -p <<EOF
open address.to.open.goes.here
user username_here password_here
ascii
cd HTML
put filename_to_upload_here
close
bye
EOF


You will need to decide if you need the
ascii
command and the
cd
command. You may or may not need them.
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Sat May 07, 2016 7:03 pm    Post subject: Reply with quote

I did it! Mr. Green
In the end I used this tutorial .
Combining the .netrc file with FTP macros and bash script.
The .ntrc file provides security so that passwords are not stored in plain text.
Then the orders are given by macdef (FTP macros) .
At the end I invoke the macro created with a bash script.
Code:
> Echo " $ updateTxt " | ftp -v ftp.ejemplo.com


.netrc file with macro:
Code:
machine ftp.ejemplo.com
login user_login
password the_user_pass

macdef updateTxt
lcd /home/juan/datas
cd /www/data/txts
put myfile.txt
bye


updata.sh script:
Code:
#!/bin/sh
echo "$ updateTxt" | ftp -v ftp.ejemplo.com


crontab:
Code:
* * * * * /home/juan/datas/updata.sh >/dev/null 2>&1

_________________
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks Smile
Back to top
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Sat May 07, 2016 7:32 pm    Post subject: Reply with quote

Sorry willyw, I had not read your answer.

The upload was made in binary format and it works.
I read that for the .txt files is advisable ascii.
But now that I work properly, I do not want to try anything else.

Did you see the solution I found in the previous answer ?
Thanks to you and caesar for their support .
_________________
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber