[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.