Sponsored Content
Operating Systems Linux Ubuntu Bash script for FTP download -Mysql Post 302961385 by virtus96 on Saturday 28th of November 2015 01:46:43 AM
Old 11-28-2015
Bash script for FTP download -Mysql

Hi guys,

I recently managed to write up my working script, but now I have a problem.
If the file isn't there in the remote server, my actual script jumps it and all ok, but I need something like this:
Search file -> if there, then download -> if not, download next file in the list.

Any suggestions?
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
DOWNLOADOSMTILES(1p)					User Contributed Perl Documentation				      DOWNLOADOSMTILES(1p)

NAME
downloadosmtiles.pl - Download map tiles from OpenStreetMap SYNOPSIS
downloadosmtiles.pl --lat=49.5611:49.6282 --lon=10.951:11.0574 --zoom=13:14 downloadosmtiles.pl --link='http://www.openstreetmap.org/?lat=-23.5872&lon=-46.6508&zoom=12&layers=B000FTF' downloadosmtiles.pl --loadtilelist=filename DESCRIPTION
This script downloads all map tiles from an OpenStreetMap tile server for some geographic region in a range of zoom levels. The PNG images of the tiles are stored in a directory tree that mirrors the paths from the server. A bounding box of geographic coordinates and a range of zoom levels must be selected by command line options. COMMAND LINE OPTIONS
Command line options may be abbreviated as long as they remain unambiguous. At least either "--latitude", "--longitude", and "--zoom" or "--link" must be specified. "--latitude=latmin[:latmax]" Selects the latitude of the bounding box of coordinates to download. May be one single real value or two real values separated by a colon in the range "-85.0511..85.0511". If given only one value, just the tile (or row of tiles) at this latitude will be downloaded. Default: none "--longitude=lonmin[:lonmax]" Selects the longitude of the bounding box of coordinates to download. May be one single real value or two real values separated by a colon in the range "-180.0..180.0". If given only one value, just the tile (or column of tiles) at this longitude will be downloaded. Default: none "--zoom=zoommin[:zoommax]" Selects the range of zoom levels to download the map tiles for. May be one single integer value or two integer values separated by a colon. OpenStreetMap supports zoom levels in the range 0..18. (This depends on the base URL and is not enforced by this script.) Note that the number of tiles to download grows by a factor of up to four with each zoom level. Default: none "--link=url" An URL selecting "--latitude", "--longitude", and "--zoom" in one argument. The idea is to select the current view of OSM's slippy map by its permalink. The argument to "--link" must be an URL containing the HTTP options "?lat=s&lon=s&zoom=s". (Actually, the base URL will be ignored.) The script chooses a box around the latitude and longitude options. The size of the box depends on the zoom option. If combined with "--latitude", "--longitude", or "--zoom", these explicitly specified values override the implicitly specified values from "--link". Default: none "--baseurl=url" The base URL of the server to download the tiles from. Default: <http://tile.openstreetmap.org> (This is the base URL for the Mapnik tiles.) "--destdir=dir" The directory where the tiles will be stored. The PNG files will be stored as "dir/zoom/x/y.png". Default: The current working directory. "--quiet" Do not write any diagnostic messages. Only fatal errors will be reported. "--dumptilelist=filename" Do not download any tiles at all, but write a list of tiles as selected by other command line options to the file named "filename". See "TILE LISTS" below. "--loadtilelist=filename" Read a list of tiles to download from the file "filename". See "TILE LISTS" below. EXAMPLE
Select the region of interest in OSM's slippy map and follow the permalink in the lower left of the window. Lets assume this permalink to be <http://www.openstreetmap.org/?lat=49.5782&lon=11.0076&zoom=12&layers=B000FTF>. Then downloadosmtiles.pl --link='http://www.openstreetmap.org/?lat=49.5782&lon=11.0076&zoom=12&layers=B000FTF' --zoom=5:18 will download all tiles from zoom level 5 to 18 for this region. TILE LISTS
A list of tiles may be stored to and retrieved from external files using the "--dumptilelist" and "--loadtilelist" command line options. A set of tiles may be selected using the command line options "--latitude", "--longitude", "--zoom", and "--link" and written to a file specified with "--dumptilelist". This list may be read at a later date using the "--loadtilelist" option. This may be useful to postpone the download of the tiles, to edit the list of tiles, or to use some external tool to generate this list. The tile lists are read and written in YAML format. Please note that this is an experimental feature in the current version. The file format is not considered stable yet. There is no guarantee that a list of tiles generated by one version of this script may be read in by a future version. ENVIRONMENT
http_proxy ftp_proxy xxx_proxy no_proxy These environment variables can be set to enable communication through a proxy server. This is implemented by LWP::UserAgent. BUGS
o Ranges in the command line options must always be increasing. While this is considered a feature for "--latitude" and "--zoom", it means that it is impossible for a range in the "--longitude" argument to cross the 180 degree line. A command line option like "--longitude=179.5:-179.5" will not work as one should expect. o The bounding box selected by the "--link" command line option does not always correspond to the current view in the slippy map. The problem is that the permalink from the slippy map only contains one position and not the bounds of the current view. The actual view of the slippy map depends on many factors, including the size of the browser window. Thus, there is not much that can be done about this issue. SEE ALSO
<http://wiki.openstreetmap.org/wiki/Slippy_Map> AUTHOR
Rolf Krahl <rotkraut@cpan.org> COPYRIGHT AND LICENCE
Copyright (C) 2008-2010 by Rolf Krahl This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2010-05-15 DOWNLOADOSMTILES(1p)
All times are GMT -4. The time now is 03:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy