12-03-2007
ftp append question
Quick question.
Will append act like 'put' if the file I'm telling it to append to doesn't exist?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
I have a simple script that runs each night and transfers a number of files to a remote server. Before files are transferred existing files on the remote box are deleted. All works OK except the deletion part on the remote box returning no such file or directory. As work around Ihave... (2 Replies)
Discussion started by: tzp2ft
2 Replies
2. UNIX for Advanced & Expert Users
Hi,
I'm attempting to FTP several files using MGET. My problem is that I need to cd to a directory with this naming convention:
YYMMDDHHMM - where the hour and minute is unknown
When I issue cd /ftpdirectory/YYMMDD* from FTP, I receive "No such file or directory
I need a way to get the... (6 Replies)
Discussion started by: kdreaves
6 Replies
3. Shell Programming and Scripting
How do I setup a parameter driven executable script which FTP's a file (input as a parameter) in Unix (AIX) to my desktop (Windows) ?
For example I would ideally like to do this -
Unix Prompt> FtpFetch abc.log
and get this abc.log on my desktop.
Thanks to anyone that can help! I am... (1 Reply)
Discussion started by: kapjag
1 Replies
4. UNIX for Dummies Questions & Answers
I have a .pl script that is grabbing information and creating two different .txt files, I need to append one to the other.
open GARPFILE;
open GARPFILEXX;
cat $gGarpFileXx >> $gGarpFile;
close GARPFILE;
close GARPFILEXX;
but I'm getting this:
Useless use... (1 Reply)
Discussion started by: mr_evans2u
1 Replies
5. UNIX for Dummies Questions & Answers
I'm basically trying to FTP a file to a differnt node, first putting the FTP commmands into a text file and then piping the commands file into the ftp command as follows....
echo "user $USERNAME $PASSWORD" > ftp_cmds
echo "put $SQLOUT /users/$USERNAME/$SQLOUT" >> ftp_cmds
echo "quit" >>... (4 Replies)
Discussion started by: djkane
4 Replies
6. Shell Programming and Scripting
I want to append a decimal number to a string. But I want to restrict the number to only 2 decimal points
for e.g:
my $output = "\n The number is = ";
my $number = 2.3333333;
$output = $output . $number;
But I want the $output as: "The number is = 2.33"; and not 2.3333333
(I do not... (1 Reply)
Discussion started by: the_learner
1 Replies
7. UNIX for Dummies Questions & Answers
What is the syntax for an ftp that is appending to the target file? I understand to use the append command, but how do you tell it which source file to append to which target file.
ftpEngine() {
ftp -inv ${FTP_SERVER} << EOF_FTP >> ${FTP_LOG}
user ${FTP_USER} ${FTP_PSWD}
cd ${FTP_DIR1}... (1 Reply)
Discussion started by: brdholman
1 Replies
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
I like to do the following, please help! Thanks a lot
for f in seq(f1 f2 f3 g1 h1 t2)
do
cut -d "+" -f2 $f > $f.nums
paste ? # each loop will attach additional column to the created file $f.nums, how to do this???
done (1 Reply)
Discussion started by: ksgreen
1 Replies
10. Shell Programming and Scripting
I'm working on a bash script to finish uploading a file.
I need a way to get $filesize so that "restart $filesize" will work.
Here is my script:
ftp -n -v <<END_SCRIPT
open ftp.$domain
user $user@$domain $password
size $file
restart $filesize
put $file
quit
END_SCRIPTWayne Sallee... (9 Replies)
Discussion started by: WayneSallee
9 Replies
LEARN ABOUT DEBIAN
anydata::storage::file
AnyData::Storage::File(3pm) User Contributed Perl Documentation AnyData::Storage::File(3pm)
NAME
AnyData::Storage::File -- manipulate files with rich warnings
DESCRIPTION
Opens, reads from, writes to, creates and destroys files with numerous
options for error handling, flocking, binmode, etc.
The simplest form is the equivalent of
my $f = AnyData::Storage::File->new(dirs=>@dirs,flock=>1);
my $str1 = $f->adSlurp($file);
for( @dirs ) {
open(IN,$file) or die $!;
}
sub slurp {
local *IN;
local $/ = undef;
}
But, depending on how you set the default behaviour
SYNOPSIS
use AnyData;
my $f = AnyData::Storage::File->new;
$f->set('binmode',1|0);
$f->set('PrintError',1|0);
$f->set('RaiseError',1|0);
$f->set('Trace',1|0);
$f->set('f_dir',$dir|$dir_array)
< input, fail if doesn't exist > output, truncate if exists, create if doesn't >> append, create if doesn't exist +< read/write, fail if
doesn't exist
r = < r+ =
new()
my $f = AnyData::Storage::File->new;
or
my $f = AnyData::Storage::File->new( %flags );
%flags is a hash which can contain any or all of:
f_dir => $directory, # defaults to './' (
binmode => $binmode, # defaults to 0 (doesn't binmode files)
printError => $warnings, # defaults to 1 (print warning on errors)
open_local_file( $fname, $mode );
Mode is one of
a = append open for reading & writing, create if doesn't exist
r = read open for reading, fail if doesn't exist
u = open open for reading & writing, fail if doesn't exist
c = create open for reading & writing, fail if it already exists
o = overwrite open for reading & writing, overwrite if it already exists
Additionally, all modes fail if the file can't be opened. On systems
that support flock, 'r' fails if a shared lock can not be obtained; the
other modes fail if an exclusive lock can't be obtained.
perl v5.10.1 2004-08-17 AnyData::Storage::File(3pm)