findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Findutils-patches] xargs problem


From: James Youngman
Subject: Re: [Findutils-patches] xargs problem
Date: Wed, 21 Dec 2016 17:39:08 +0000

On Tue, Dec 20, 2016 at 9:35 PM, aws backup <address@hidden> wrote:

I see that you now have an explanation, but I have some additional
advice, below.


> Now what's happening. I change a filename. xargs transfers first the old file 
> name (before renaming) to the script. Therefore I get the notifications 
> upload started and upload done for the old filename and following error from 
> s3cmd (also as email):

Here's the advice.   Because your script is invoked with the path name
of interest as a command-line argument, you don't need to make
spurious changes to the file system in order to test it.   You can
just run it by hand.

s3cmd.sh /tmp/my-test-file.txt

Then if it doesn't do what you want, edit it a bit and try again.   If
you're not sure what's happening, use the shell's trace option:

sh -x s3cmd.sh /tmp/my-test-file.txt

(there's a knack to reading the output but you'll get it I'm sure).

Testing things this way is often much more efficient.   If side
effects such as sending email would be a problem during testing, you
can copy your original script to a new file, disable the email feature
in the new file, figure out what was causing your original problem
(though obviously in reality you know this now anyway) and apply the
fix you choose to the original script.

Hope this helps in the future,
James.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]