Operating System - HP-UX
1837069 Members
2852 Online
110111 Solutions
New Discussion

tar behaves different when used with CRON and AT

 
Alzhy
Honored Contributor

tar behaves different when used with CRON and AT

When a tar job is run using AT -- it is restricted to creating a tar file that is 2GB or less. If CRON is used - tar can create the archive file beyond 2GB.

Is this normal? Has anyone encountered this odd behaviour? What could be the reason?


Thanks.
Hakuna Matata.
6 REPLIES 6
Chris Vail
Honored Contributor

Re: tar behaves different when used with CRON and AT

Interesting point.....have you brought this to the attention of HP? AFAICT, this is a problem in compiling the at command....




Chris
Jeff Schussele
Honored Contributor

Re: tar behaves different when used with CRON and AT

Hi Nelson,

That's interesting.....

NEITHER cron nor at should be able to create a tar volume greater than 2Gb. That's a limitation of tar itself.

How *much* larger than 2Gb does cron get the tar volume?

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
James R. Ferguson
Acclaimed Contributor

Re: tar behaves different when used with CRON and AT

Hi:

If you look at the man pages for proto(4) it is noted that 'at' jobs use the current file limit ('ulimit') as derived from the parent environment.

Since 'cron' has been initiated by root, its job's environment is different.

As for the standard HP-UX 'tar' the man pages note "...tar does not support the archival of files larger than 2GB". With 11.11, PHCO_26423 enables archival of files up to 8GB.

Regards!

...JRF...
monasingh_1
Trusted Contributor

Re: tar behaves different when used with CRON and AT

In case of such problems, I would run "env" and "set" commands from AT and cron and save their output in files to compare what the difference is in their environment and many times that helps a lot..

hope this helps..
Steven E. Protter
Exalted Contributor

Re: tar behaves different when used with CRON and AT

The latest tar upgrade enables files of up to 8G

PHCO_26423 on 11.11

My guess is your cron job isn't using the full path of tar or the two methods use different versions of tar.

PHCO_24633 is probably the 11.00 patch. If course I haven't tested tars bigger than 2G, but I learned about that patch on these forums.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alzhy
Honored Contributor

Re: tar behaves different when used with CRON and AT

This was not a problem with tar - either archiving >2GB largefiles or creating a >2Gb tar file. The problem as it turned out was due to AT passing ulimit to the execution enviornment via the at wrapper /var/adm/cron.proto. The user was additionally running ksh which effectively set her ulimit to 2GB. Cron works because it does not pass the ulimit or uses root's profile? so the 2GB tar output limit is not in force. If the user is using Bourne shell as the default shell -- then ulimit is unlimited and using AT to submit a largefile tar job would not be a problem.
Hakuna Matata.