[Solved] Simple Shellscript for uploading files to a specific folder on a ftp-server?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [Solved] Simple Shellscript for uploading files to a specific folder on a ftp-server?
# 8  
Old 02-03-2014
What surprises me is that the log is not clear : Looks more like a ftpd log to me aka ftpserver and not the ftp client...
more Q: what OS and version are you using? and what shell... ( I suppose a minimalist linux version since you mentinned D-link...)
If we are talking of files generated on the D-link to be uploaded elsewhere on the same device then simple copy cp or mv could do the job no?
# 9  
Old 02-03-2014
Ok, I tried another script using curl instead.
this script is even simplier...

Code:
curl -u "username:password" --upload-file test.txt ftp.b10.levonline.com/public_html/fotosupport.se/Nigge --no-epsv

This time all I get is the following:
Quote:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0
curl: (25) Failed FTP upload: 553
Any tips?Smilie

---------- Post updated at 12:57 PM ---------- Previous update was at 12:47 PM ----------

Quote:
Originally Posted by vbe
What surprises me is that the log is not clear : Looks more like a ftpd log to me aka ftpserver and not the ftp client...
more Q: what OS and version are you using? and what shell... ( I suppose a minimalist linux version since you mentinned D-link...)
If we are talking of files generated on the D-link to be uploaded elsewhere on the same device then simple copy cp or mv could do the job no?
Yes, that was my guess as welll, I dont know what ftp-client to use and how to make the scripts for that one, I installed curl but I got another error message on that oneSmilie

The OS-version is Linux dlink-469621 2.6.22.18 #23 Wed May 25 15:48:30 CST 2011 armv5tejl GNU/Linux"
I guess its a minimalistic version yes,

Its not files generated by the D-link but generated by a java application, but they are just two txt-files, however I want to access them via the internet so I want them on my the webserver where I have my webpage (levonline)

So thats why I need a FTP-upload

---------- Post updated at 01:00 PM ---------- Previous update was at 12:57 PM ----------

When I try to upload it onto the root of the ftp-server it works
So I guess its the upload to a specific part on the ftp server that doesnt work...
So...
curl -u usernameSmilieassword --upload-file test.txt ftp.bxx.levonline.com works

but


curl -u usernameSmilieassword --upload-file test.txt ftp.bxx.levonline.com/fotosupport.se/Nigge
doesnt work at all
# 10  
Old 02-03-2014
@vbe: correct - but then his ftp command (used in the script) might be a link? an alias? a renamed server entry?
# 11  
Old 02-03-2014
Code:
curl -u username:password --upload-file /ffp/home/root/1282123.txt ftp.b10.levonline.com/public_html/fotosupport.se/Nigge/

this made it work! when i ran the shellscript
but when I schedule it to cron, it does not work anymore...

what might be wrong?

Moderator's Comments:
Mod Comment Code tags for code, please.
# 12  
Old 02-03-2014
This question is so common its in our FAQ.

cron does not have the same PATH settings you have. Try /absolute/path/to/curl, which you can get with 'which curl' or 'whereis curl'.
# 13  
Old 02-03-2014
I am using the complete path to curl...?


#! /bin/sh
/ffp/bin/curl -u user_password --upload-file /ffp/home/root/1282123.txt ftp.b10.levonline.com/public_html/fotosupport.se/Nigge/
# 14  
Old 02-03-2014
OK, so what did you put in your crontab then?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies

2. Shell Programming and Scripting

Copy folder and files from unix server to linux server

We would be migrating unix solaries to Linux redhat. Basically source is unix and target is linux. i would like to copy entire file system unix/source/* to target linux/souce/* but target linux has only folder setup so what ever files copied need to be placed in the linux server with same... (8 Replies)
Discussion started by: balajikalai
8 Replies

3. UNIX for Dummies Questions & Answers

[Solved] Touch 10% of the total files inside a folder

I'm trying to make this code below to work but I can't find the way to do the following: I want to make the script to touch only 10% of the total amount of files counted inside the given directory instead of all like it is now. I would greatly appreciate it if someone can give me a direction on... (9 Replies)
Discussion started by: regraphix
9 Replies

4. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

5. Shell Programming and Scripting

transfering files with a specific name to a folder

Hi I want to transfer all files in a folder to another folder. So the files have a ending of .lop.txt thanks (4 Replies)
Discussion started by: gisele_l
4 Replies

6. Shell Programming and Scripting

how to FTP a file from the local folder to unix server

Hi All, please help me to write a shell that ftp a file which is in the local (C:\) drive to a Unix server. Where as i know the IP for the Unix server. i could do this process by using ftp command. pls help me to write as Shell script. Thanks in advance for all of your answers.:b::b: (3 Replies)
Discussion started by: little_wonder
3 Replies

7. UNIX for Dummies Questions & Answers

To find files with specific dates and cp another folder.

Hi all, We have an existing script: find /u03/oraprod/perpcomn/admin/out -type f -ctime +7 \ -exec cp {} "/u08/oraprod/backup/cout" \; Which is to find all files more than 7 days and copy to another folder. However I would like to only list files with Sep 29, and cp to another folder. ... (2 Replies)
Discussion started by: *Jess*
2 Replies

8. Shell Programming and Scripting

Simple script uploading *.dem files to an ftp

Hello.. i want to create a simple script that's upload all the *.dem files from one directory to ftp and then delete them. Any help? (3 Replies)
Discussion started by: TuXaKoS
3 Replies

9. Shell Programming and Scripting

ftp a files from a folder

Hi Can anyone give me a shell script to ftp all the files in a folder to a another machine .And if the ftp is sucees i want to move the files to the same to another folder in the same client m/c (2 Replies)
Discussion started by: dineshr85
2 Replies
Login or Register to Ask a Question