| View previous topic :: View next topic |
| Author |
Message |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat May 07, 2016 4:42 pm Post subject: |
|
|
| 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 |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sat May 07, 2016 7:03 pm Post subject: |
|
|
I did it!
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.
.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:
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  |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sat May 07, 2016 7:32 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
|