Bash script for FTP download -Mysql


 
Thread Tools Search this Thread
Operating Systems Linux Ubuntu Bash script for FTP download -Mysql
# 8  
Old 11-29-2015
Yes, sort of
Code:
prepare URLfile
wget --input-file URLfile
for FN in /path/to/*.zip
do
... whatever ...
done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Curl , download file with user:pass in bash script

Hello, My question is about curl command. (ubuntu14.04) In terminal, I am able to download my mainfile with: curl -u user1:pass1 http://11.22.33.44/******* When I convert it into bash script like this: #!/bin/bash cd /root/scripts computer_ip=11.22.33.44 curl -u $1:$2... (8 Replies)
Discussion started by: baris35
8 Replies

2. Shell Programming and Scripting

Csv download in a bash script

I am attempting to download a url in csv format. When I download this url in a browser excel opens up and automatically populates with comma separated values. When I try to use curl or wget I get nothing or garbage. This on the command line just hangs wget -b... (2 Replies)
Discussion started by: bash_in_my_head
2 Replies

3. Shell Programming and Scripting

Shell script - Download - Mysql replace

Hi, I have a video script. it has embedded Youtube videos. I want replace them downloaded version mp4 videos. this script has a mysql table. I want search "url_flv" field on table a youtube link if has a youtube link I want download it this command. I want extract uniq_id field for file... (2 Replies)
Discussion started by: tara123
2 Replies

4. Shell Programming and Scripting

Download latest file via ftp server unix through shell script

Hello this is my first post in this forum , I dont want to be unhappy.. I am writing one script but facing difficulty to find the latest file with some new pattern My requirement is 1. The file is coming like "ABCD-23220140303" at FTP server once in a week. 2. script will run on daily... (3 Replies)
Discussion started by: ajju
3 Replies

5. Shell Programming and Scripting

FTP download using perl script

Need assistance I have a script which i can download the files from ftp server using perl . But i want to download multiple files at a time #!/usr/bin/perl -w use Net::FTP; $ftp = Net::FTP->new("ftp.ncdc.noaa.gov"); $ftp->login('username', 'password'); $ftp->cwd("<dir>");... (9 Replies)
Discussion started by: ajayram_arya
9 Replies

6. Shell Programming and Scripting

Download files every one second using ftp script

Our main Server "Srv1" is used to generate text files based on specified criteria and it is also connected to two clients (pc1 and pc2) which are responsible for getting the files from Srv1 as it follows: 1. pc1 ( which represents my UNIX machine ) uses shell script to copy the files from Srv1 2.... (3 Replies)
Discussion started by: arm
3 Replies

7. Shell Programming and Scripting

Need of shell script to download data using ftp

Hi ! I am just wondering shell script to download data from ftp... I have text file containing ftp address...looks like this ftp://site...../filename.xyz ftp://site...../filename.xyz ftp://site...../filename.xyz ftp://site...../filename.xyz script has to read ftp address and... (8 Replies)
Discussion started by: nex_asp
8 Replies

8. Shell Programming and Scripting

ftp script doesn't download jpg properly

ftp script doesn't download jpg properly The downloaded files have color splotches Here is the script: ftp -n me@institute.edu <<END_SCRIPT quote user name quote pass password prompt mget *.jpg quit END_SCRIPT exit 0 cd ../ (2 Replies)
Discussion started by: walforum
2 Replies

9. Shell Programming and Scripting

Help on FTP download using UNIX script

Hi guys, I'm new on this forum and on UNIX. Can somebody help in writing a script to download a file from an FTP server and validating if there is a file to download. If there is a file, I would send it to a mail recipient and if not I would generate an error log. Thanks in advance!:D (1 Reply)
Discussion started by: rjay_45
1 Replies

10. Shell Programming and Scripting

script for download files from ftp site

I'm new to scripting. I'm trying to write a script to download files from ftp site, the following is the script and the message i get after running the script. no files were downloaded :( Thanks advance! script: #!/usr/bin/ksh DAY=`date --date="-1 days" +%y%m%d` ftp -v -n "ftp.address" <<... (5 Replies)
Discussion started by: tiff-matt
5 Replies
Login or Register to Ask a Question
FTP_GET(3)								 1								FTP_GET(3)

ftp_get - Downloads a file from the FTP server

SYNOPSIS
bool ftp_get (resource $ftp_stream, string $local_file, string $remote_file, int $mode, [int $resumepos]) DESCRIPTION
ftp_get(3) retrieves a remote file from the FTP server, and saves it into a local file. PARAMETERS
o $ftp_stream - The link identifier of the FTP connection. o $local_file - The local file path (will be overwritten if the file already exists). o $remote_file - The remote file path. o $mode - The transfer mode. Must be either FTP_ASCII or FTP_BINARY. o $resumepos - The position in the remote file to start downloading from. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 ftp_get(3) example <?php // define some variables $local_file = 'local.zip'; $server_file = 'server.zip'; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // try to download $server_file and save to $local_file if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) { echo "Successfully written to $local_file "; } else { echo "There was a problem "; } // close the connection ftp_close($conn_id); ?> SEE ALSO
ftp_pasv(3), ftp_fget(3), ftp_nb_get(3), ftp_nb_fget(3). PHP Documentation Group FTP_GET(3)