Sponsored Content
Full Discussion: FTP Photo using Linux script
Top Forums Shell Programming and Scripting FTP Photo using Linux script Post 302897742 by in2nix4life on Tuesday 15th of April 2014 04:34:41 PM
Old 04-15-2014
Perhaps something like this:

Code:
#!/bin/bash
#
#

# set the url to the security camera
url="<insert url to camera image here>"

# create a temp directory to hold the downloaded
# images
tmpDir="/tmp/camphotos"
if [ ! -d $tmpDir ]
then
    mkdir $tmpDir
fi

# use curl command to fetch the file and rename it
# on the fly
cd $tmpDir
curl -L -o Bus1+$(date +'%m%d%Y_%T').jpg -C - $url

# store the name of the file we just downloaded
new_image=$(ls -ltr $tmpDir | tail -n1 | awk '{print $NF}')

# use curl to upload it to ftp server
curl -u busprotect:busprotect -T $new_image ftp://10.0.0.51/

# done
exit 0

76c8abfb508c3ff189fd695be44b05e3
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

2. Shell Programming and Scripting

FTP from Linux to windows server by shell script

Hi, Please advice whether my below requirement is feasible, My requirement : Automated FTP from linux server to windows server using a shell script on every monday. If feasible, please help me how to do this ? Thanks in advance (2 Replies)
Discussion started by: apsprabhu
2 Replies

3. Shell Programming and Scripting

passing parameter to ftp script from output of another ftp

Hi, I have a ftp script which first gets all the file names and echo's the latest file. I'm using another ftp command sets to get the file name given by first ftp. The problem is the parameter is not accepted by second ftp. The error message i'm getting is > Rename Temp File calloc:ICMP... (5 Replies)
Discussion started by: ammu
5 Replies

4. UNIX for Dummies Questions & Answers

ascii FTP from Linux to Linux adding carriage returns

Hi, I've got an issue with a shell script that FTP's a file from one Linux server to another Linux server. My script runs on a Linux server and creates an output file (from a database call), and then FTP's this file to another Linux server. The problem is that, even though the output file... (0 Replies)
Discussion started by: roysterdoyster
0 Replies

5. Shell Programming and Scripting

Automated FTP script using .netrc to multiple FTP servers

Hi all, I'm using the following script to automated ftp files to 1 ftp servers host=192.168.0.1 /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine 192.168.0.1 login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

6. UNIX for Advanced & Expert Users

ftp in shell script from linux to windows XP

Hi, I have 9 different linux based servers and i am automating there healthcheckup by doing ssh and fetching deviations out of it in a single text file. I am doing so by using ssh keygen. I am done with the above part . Now i want to ftp that text file to my windows XP desktop and i want to... (4 Replies)
Discussion started by: gemnian.g
4 Replies

7. UNIX for Dummies Questions & Answers

Script to ftp in to linux then pass reply

Hello, I have an ftp loop script which I was going to use to login to various Linux systems but as It's my first connection I'm being prompted to add it to the known_hosts. Can this script be modified to reply 'yes' before passing the user/pass ? usname="someuser" pass="somepass" while read... (1 Reply)
Discussion started by: Grueben
1 Replies
ftp(4)								   File Formats 							    ftp(4)

NAME
ftp - FTP client configuration file SYNOPSIS
/etc/default/ftp DESCRIPTION
Use the ftp file to configure the behavior of the FTP client. Lines that begin with a hash symbol ("# ") are treated as comment lines and are ignored. Behavior Directives The ftp file supports the following behavior directives: FTP_LS_SENDS_NLST=yes | no The ls command of the ftp client sends an NLST to the FTP Server by default. Several non-Solaris clients send LIST instead. In order to make the Solaris ftp client send LIST when the ls command is issued, set FTP_LS_SENDS_NLST to no. The value of FTP_LS_SENDS_NLST is yes by default. If the user sets a value for FTP_LS_SENDS_NLST in the user's environment, this value will override any FTP_LS_SENDS_NLST directive that is specified in /etc/default/ftp. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbipr | +-----------------------------+-----------------------------+ SEE ALSO
ftp(1), attributes(5) SunOS 5.10 22 Oct 2002 ftp(4)
All times are GMT -4. The time now is 06:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy