WSUS Offline Updater as cronjob

WSUS Offline Updater as cronjob

Postby Buster » 22.05.2013, 13:36

Hi,

I try to run wsusoffline as cronjob and have it set up like this in /etc/crontab
Code: Select all
# wsusoffline.net Windows Updates Offline ISO-Images
# Windows 8 / Server 2012
00 23   * * 2   root    test -x /srv/wsusoffline/sh/DownloadUpdates.sh && /bin/bash /srv/wsusoffline/sh/DownloadUpdates.sh w62-x64 deu /makeiso /dotnet /msse >/dev/null

As you can see I've added /bin/bash to the path to circumvent some TERM requirements and redirect output to /dev/null for silent updates of the iso images. But I'm still getting TERM warnings and overall output which is not expected.
Code: Select all
TERM environment variable not set.
TERM environment variable not set.
TERM environment variable not set.
../client/wsus/wsusscn2_1.cab: WARNING; possible 16088 extra bytes at end of file.
TERM environment variable not set.
TERM environment variable not set.
TERM environment variable not set.
Warning: Creating ISO-9660:1999 (version 2) filesystem.
Warning: ISO-9660 filenames longer than 31 may cause buffer overflows in the OS.
  0.21% done, estimate finish Wed May 22 10:54:42 2013
[...]
 99.94% done, estimate finish Wed May 22 11:03:34 2013
Total translation table size: 0
Total rockridge attributes bytes: 73748
Total directory bytes: 178176
Path table size(bytes): 582
Max brk space used 8f000
2351374 extents written (4592 MB)

Is there any way to fix this? I don't want to run the script in a screen session merely to ignore output.
Buster
 

Re: WSUS Offline Updater as cronjob

Postby cookie1980 » 11.06.2013, 15:09

You should set the environment var in your profile.
.bashrc:
Code: Select all
export TERM=/bin/bash

Replace bash with your default shell.
cookie1980
 

Re: WSUS Offline Updater as cronjob

Postby hhullen » 09.07.2013, 11:34

cookie1980 wrote:You should set the environment var in your profile.
.bashrc:
Code: Select all
export TERM=/bin/bash

Replace bash with your default shell.


Sorry - that leads to another error message.

I've just added
export TERM=xterm
#


in "Path/to/wsusou/sh/commonparts.inc"

And now the system does not more miss the "TERM" variable.
Viele Grüsse
Helmut
hhullen
 
Posts: 100
Joined: 23.04.2012, 10:43

Re: WSUS Offline Updater as cronjob

Postby Buster » 07.08.2013, 08:45

Thank you for this hint.

Additionally i changed DownloadUpdates.sh because of this warning which seems to be error output from cabextract on STDERR:
../client/wsus/wsusscn2_1.cab: WARNING; possible 16088 extra bytes at end of file.

So i changed
Code: Select all
cabextract -q -F package.cab ../client/wsus/wsusscn2_1.cab
to
Code: Select all
cabextract -q -F package.cab ../client/wsus/wsusscn2_1.cab 2>/dev/null


I'll watch my mails from cron again.
Buster
 

Re: WSUS Offline Updater as cronjob

Postby hhullen » 14.08.2013, 10:25

Buster wrote:esehen

Additionally i changed DownloadUpdates.sh because of this warning which seems to be error output from cabextract on STDERR:
../client/wsus/wsusscn2_1.cab: WARNING; possible 16088 extra bytes at end of file.

So i changed
Code: Select all
cabextract -q -F package.cab ../client/wsus/wsusscn2_1.cab
to
Code: Select all
cabextract -q -F package.cab ../client/wsus/wsusscn2_1.cab 2>/dev/null

.


Sollte problemlos funktionieren - ich habe in diesem Umfeld bisher einzig diese Warnung gesehen, keine einzige Fehlermeldung.
Viele Grüsse
Helmut
hhullen
 
Posts: 100
Joined: 23.04.2012, 10:43

Re: WSUS Offline Updater as cronjob

Postby WSUSUpdateAdmin » 14.08.2013, 16:19

WSUSUpdateAdmin
Administrator
 
Posts: 2245
Joined: 07.07.2009, 14:38

Re: WSUS Offline Updater as cronjob

Postby MacKeon » 05.10.2013, 17:55

hhullen wrote:
cookie1980 wrote:You should set the environment var in your profile.
.bashrc:
....


The Cron-Job don't use all User-Environment-Configuration-Files, so ".bashrc" or ".profile".

You can see this with the PATH-variable, that doesn't contain the PATH-Environment that cames from the User-Configfiles.
MacKeon
 


Return to Linux

Who is online

Users browsing this forum: No registered users and 50 guests

cron