From: "Abraham Schneider" <aschneider@(email surpressed)>
Subject: Re: Automatically delete logs when dumping job?
   Date: Mon, 28 Jan 2008 10:49:15 -0500
Msg# 1667
View Complete Thread (7 articles) | All Threads
Last Next
Hi Greg!

Thanks for your answer. Haven't had time to look on this topic for some days. Now that I did, I just recognized that I just don't know how to reference to the actual script I submitted from inside my dumpcommand script. This maybe a stupid question, but I'm a shake artist and not a fulltime programmer/scripter ;-)

Would be nice if you could give me a hint. Are there any variables that I can use in a shell script or how does this work?

Thanks, Abraham


Greg Ercolano schrieb:
[posted to rush.general]

Abraham Schneider wrote:
[posted to rush.general]

Hi there!

I'm just wondering how I can automatically delete the logs of a
particular job when dumping this job?

I think that should be possible with the Job Dump Command, but
I'm wondering about this description in the online help:

'The log output of the command will be written to a file in the
Log Directory calles "jobdumpcommand.log"'

Does this mean that I get a file which grows bigger and bigger?
That wouldn't be that perfect.

	You probably want to include the -nolog flag, eg:
      http://www.seriss.com/rush-current/rush/rush-submit-cmds.html#JobDumpCommand

	Relevant quotes from the above:

--- snip
The option -nolog can be specified to disable the creation of the
'jobdumpcommand.log' file. This is useful to prevent 'file in use'
errors on Windows if you want the command to remove the entire logdir
as part of a cleanup operation."
[..]
The stdout and stderr output from the command is written to a file
called 'jobdumpcommand.log' in the LogDir. This can be disabled if
LogDir is disabled, or if the jobdumpcommand's '-nolog' option is
specified, eg. jobdumpcommand -nolog <command..>.
--- snip

	So when you fill out the form, you can specify:

		Job Dump Command: -nlog perl /path/to/your/cleanup.pl

	..and that will prevent the log from being created for your
	cleanup commands. You may want to redirect the output of
	the cleanup script somewhere else, so that you can still
	see errors.

	I should add the above to the "?" docs in the submit forms
	for all the "Job XXX Command" prompts.

	I think it never came up, because folks doing cleanup scripts
	have usually been writing their own custom submit scripts, and
	referred to the above docs when creating the actual rush submit
      commands.

	BTW, *be careful* when you write cleanup scripts!
	The common thing is to do 'rm -rf' on paths, but watch out;
	a small typo in a pathname might cause your cleanup script
	to recursively remove an entire prod directory if you're
	not careful how you write it. For instance, if the user
	submitted a scene file with a space somewhere in the pathname,
	the job fails, and then they dump the job, that stray space
	might cause big trouble when your cleanup script runs the
	resulting "rm -rf" command, eg:

            rm -rf /yourserver/BIGPROJECT /SCENES/1A/myproject.junk
                                        ^^^
                                        Stray space typed by user,
					  causes BIGPROJECT to be removed!

	..so be sure to prevent that kind of thing by carefully quoting
	your pathnames, or calling internal commands (like perl's remove())
	directly, to avoid spaces being interpreted as path separators.



--
Abraham Schneider
Senior VFX Compositor
ARRI Film & TV Services GmbH  Tuerkenstr. 89  D-80799 Muenchen / Germany
Phone (Tel# suppressed) Email aschneider@(email surpressed)
www.arricommercial.de
www.arri.de

ARRI Film & TV Services GmbH
Sitz: München  -  Registergericht: Amtsgericht München  -  Handelsregisternummer: HRB 69396
Geschäftsführer: Franz Kraus

Last Next