LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-28-2004, 11:14 AM   #1
dezeque
LQ Newbie
 
Registered: Mar 2004
Location: Switzerland
Distribution: Fedora core2
Posts: 19

Rep: Reputation: 0
Question NCFTP bash script


Hi, i'm a newbie of scripting and urgently need to do a script witch can upload a file and by erasing the old one on the server :

i have a webcam on a computer behind a proxy the webcam give me every 15 secondes a new image. my image is called pic.jpg every 15 sec pic.jpg is erased by the new one.

i want to auto upload it with a script that i will auto execute with crontab.
so ? anyone know how to do a bash script witch can connect the my ftp server with login password and upload the picture. ? and at all times must erase the file (replace by the old one by the new one).

??????

Thanks in advance


NB : and know if i can use proxy authentification by ncftp ? becuase i have to login to pass throught it.






Last edited by dezeque; 04-28-2004 at 11:19 AM.
 
Old 04-29-2004, 03:55 PM   #2
dezeque
LQ Newbie
 
Registered: Mar 2004
Location: Switzerland
Distribution: Fedora core2
Posts: 19

Original Poster
Rep: Reputation: 0
resolved

I found the solution just fill the variables in the begin of the script.
# comment are in french (nervermind them)

#!/bin/bash
ftp -i <<*fin*
#------Variables----------
ADR=""
LOGIN=""
PASS=""
IMAGE=""
#-------------------------
echo -----------------------
echo Démarrage de l'upload.
echo -----------------------
open $ADR
$LOGIN
$PASS
bin
put /var/www/html/webcam/$IMAGE
bye
*fin*
echo
echo ------------------------------
echo UPLOAD DE L'IMAGE : OK
date
echo ------------------------------

Last edited by dezeque; 04-29-2004 at 03:56 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ncftp commands.. kurrupt Linux - Software 1 08-23-2004 06:55 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
bash script - incrementing a filename in a script tslinux Programming 10 08-05-2003 11:58 PM
bash script prob: how can i tell the script that a 'dd' has finished? Frustin Linux - General 2 04-02-2003 05:34 AM
where can i get the sourcecode of Ncftp? whepin Linux - General 3 03-30-2002 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration