Sponsored Content
Full Discussion: Ftp script with date
Top Forums Shell Programming and Scripting Ftp script with date Post 303000641 by fretagi on Monday 17th of July 2017 05:08:04 AM
Old 07-17-2017
Hi

I am trying a different way of doing that by copying the last file to a directory, them ftp the file to another server, but my cp command is failing with syntax error such as:

Code:
 pwd
/opt/fundamo/reports
-bash-3.00$ ls -lrt FundamoSettlement* | tail -1
-rw-r--r--   1 fundamo  fundamo   604080 Jul 17 02:18 FundamoSettlement_1500250109585.csv
-bash-3.00$ cp -p `ls -lrt FundamoSettlement* | tail -1` /opt/fundamo/reports/tobesent/
cp: illegal option -- w
cp: illegal option -- -
cp: illegal option -- -
cp: illegal option -- -
cp: illegal option -- -
cp: illegal option -- -
Usage: cp [-f] [-i] [-p] [-@] f1 f2
       cp [-f] [-i] [-p] [-@] f1 ... fn d1
       cp -r|-R [-H|-L|-P] [-f] [-i] [-p] [-@] d1 ... dn-1 dn
-bash-3.00$

please can you help?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ftp by date filter

i would be grateful if someone could supply me with a shell script which performed a ftp but only retrieved files which had a created date greater than a specific date - is this possible with ftp? many thanks mc (1 Reply)
Discussion started by: campbem
1 Replies

2. Shell Programming and Scripting

automated ftp script from unix -date range of files

Hi , I need some help to finish my ftp script and i need to find the last one weeks of fles updated in the sepecific directory and see those end with Z and ftp them to my backup server. Any help is appreciated. Thanks, Ravi :) (1 Reply)
Discussion started by: koduri0475
1 Replies

3. Programming

automated ftp script from unix -date range of files

Hi , I need some help to finish my ftp script and i need to find the last one weeks of fles updated in the sepecific directory and see those end with Z and ftp them to my backup server. Any help is appreciated. Thanks, Ravi :) (1 Reply)
Discussion started by: koduri0475
1 Replies

4. UNIX for Advanced & Expert Users

automated ftp script from unix -date range of files

Hi , I need some help to finish my ftp script and i need to find the last one weeks of fles updated in the sepecific directory and see those end with Z and ftp them to my backup server. Any help is appreciated. Thanks, Ravi :) (1 Reply)
Discussion started by: koduri0475
1 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 Dummies Questions & Answers

How to view date during FTP

date command does not work during FTP. how can we view the system or server date during FTP. (2 Replies)
Discussion started by: Shell_Learner
2 Replies

7. Shell Programming and Scripting

append date time stamp via ftp script

I have searched several thread and not found my solution, so I am posting a new qustion. I have a very simple script on an AIX server that FTPs 2 files to a MS FTP server. These 2 files are created on the AIX server every hour, with a static name. I need to FTP the files to the MS server, but... (1 Reply)
Discussion started by: sknisely
1 Replies

8. Shell Programming and Scripting

FTP script date based

Have Solaris 10 server and a 2008 server.:cool: Would like to FTP files from Solaris server into the 2008 server.:rolleyes: FTP to be executed by 2008 scheduler on a daily basis.:p FTP need to copy files 1 day old (on the Solaris), current Solaris folder holds more than 90 files, only last one... (1 Reply)
Discussion started by: pointer
1 Replies

9. Shell Programming and Scripting

How to FTP the latest file, based on date, from a remote server through a shell script?

How to FTP the latest file, based on date, from a remote server through a shell script? I have four files to be FTP'ed from remote server. They are of the following format. build1_runtime_mmddyyyy.txt build2_runtime_mmddyyyy.txt build3_runtime_mmddyyyy.txt buifile_count_mmddyyyy.txt ... (9 Replies)
Discussion started by: imran_affu
9 Replies

10. Shell Programming and Scripting

Ftp files with date

Hi, i need to put files with current date at end from one server to another. i.e. all the output files from below comand. ls -ltr `date '+monthly_stats.sh%y%m%d'` am using mput `date '+monthly_stats.sh%y%m%d'` but no files are transfered Connected to gbdsnh18.hartfordlife.com. 220... (5 Replies)
Discussion started by: Simanto
5 Replies
DBA_OPEN(3)								 1							       DBA_OPEN(3)

dba_open - Open database

SYNOPSIS
resource dba_open (string $path, string $mode, [string $handler], [mixed $...]) DESCRIPTION
dba_open(3) establishes a database instance for $path with $mode using $handler. PARAMETERS
o $path - Commonly a regular path in your filesystem. o $mode - It is r for read access, w for read/write access to an already existing database, c for read/write access and database creation if it doesn't currently exist, and n for create, truncate and read/write access. The database is created in BTree mode, other modes (like Hash or Queue) are not supported. Additionally you can set the database lock method with the next char. Use l to lock the database with a .lck file or d to lock the databasefile itself. It is important that all of your applications do this consis- tently. If you want to test the access and do not want to wait for the lock you can add t as third character. When you are abso- lutely sure that you do not require database locking you can do so by using - instead of l or d. When none of d, l or - is used, dba will lock on the database file as it would with d. Note There can only be one writer for one database file. When you use dba on a web server and more than one request requires write operations they can only be done one after another. Also read during write is not allowed. The dba extension uses locks to prevent this. See the following table: DBA locking +-------------+---------------+---+---+---+---+---+---+---+ |already open | | | | | | | | | | | | | | | | | | | | | $mode = "rl" | | | | | | | | | | | | | | | | | | | | $mode = "rlt" | | | | | | | | | | | | | | | | | | | | $mode = "wl" | | | | | | | | | | | | | | | | | | | | $mode = "wlt" | | | | | | | | | | | | | | | | | | | | $mode = "rd" | | | | | | | | | | | | | | | | | | | | $mode = "rdt" | | | | | | | | | | | | | | | | | | | | $mode = "wd" | | | | | | | | | | | | | | | | | | | | $mode = "wdt" | | | | | | | | | | | | | | | | | | +-------------+---------------+---+---+---+---+---+---+---+ | not open | | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | |$mode = "rl" | | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | wait | | | | | | | | | | | | | | | | | | | | false | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | |$mode = "wl" | | | | | | | | | | | | | | | | | | | | | wait | | | | | | | | | | | | | | | | | | | | false | | | | | | | | | | | | | | | | | | | | wait | | | | | | | | | | | | | | | | | | | | false | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | |$mode = "rd" | | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | ok | | | | | | | | | | | | | | | | | | | | wait | | | | | | | | | | | | | | | | | | | | false | | | | | | | | | | | | | | | | | | |$mode = "wd" | | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | illegal | | | | | | | | | | | | | | | | | | | | wait | | | | | | | | | | | | | | | | | | | | false | | | | | | | | | | | | | | | | | | | | wait | | | | | | | | | | | | | | | | | | | | false | | | | | | | | | | | | | | | | | | +-------------+---------------+---+---+---+---+---+---+---+ ook: the second call will be successfull. owait: the second call waits until dba_close(3) is called for the first. ofalse: the second call returns false. oillegal: you must not mix "l" and "d" modifiers for $mode parameter. o $handler - The name of the handler which shall be used for accessing $path. It is passed all optional parameters given to dba_open(3) and can act on behalf of them. RETURN VALUES
Returns a positive handle on success or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 4.3.0 | | | | | | | It's possible to open database files over net- | | | work connection. However in cases a socket con- | | | nection will be used (as with http or ftp) the | | | connection will be locked instead of the resource | | | itself. This is important to know since in such | | | cases locking is simply ignored on the resource | | | and other solutions have to be found. | | | | +--------+---------------------------------------------------+ SEE ALSO
dba_popen(3), dba_close(3). PHP Documentation Group DBA_OPEN(3)
All times are GMT -4. The time now is 09:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy