[Novalug] nohup and chaining commands
Ken Kauffman
kkauffman at headfog.com
Thu Oct 23 09:25:02 EDT 2008
Is there a reason you aren't doing this:
nohup cmd1 > /shared/dir/[file] &
You could also do this:
touch /shared/dir/[file] & chmod /shared/dir/[file] & nohup cmd1 >>
/shared/dir/[file] &
K
On Thu, Oct 23, 2008 at 08:21, Jon Taimanglo <jontaimanglo at gmail.com> wrote:
> I want to chain together multiple commands. The first command usually
> takes a while to run and I usually background it:
>
> nohup cmd1 &
>
> The problem ends up being that when the file is created from this command
> the permissions are set as 600. I want to chmod the file when cmd1 (cmd1
> allows me to name the output file as an argument) is done then cp it to a
> shared directory (however, I can cp then chmod - as long as cmd1 has
> completed).
>
> What is the proper format for chaining these commands? I want to be able
> to fire this off at the command line and close my putty session and know
> that when cmd1 is done, someone else with access to the shared directory can
> view the output.
>
> I don't think the following would work, but would like to know what would.
>
> nohup cmd1 &; chmod 600 <outputfilefrom cmd1>; cp -p <outputfilefrom cmd1>
> /shared/dir
>
> Thanks.
>
> Jon
>
>
> _______________________________________________
> Novalug mailing list
> Novalug at calypso.tux.org
> http://calypso.tux.org/cgi-bin/mailman/listinfo/novalug
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://calypso.tux.org/pipermail/novalug/attachments/20081023/258583f0/attachment.html
More information about the Novalug
mailing list