Posted on 07-14-2011 01:17 PM
Hi,
We are packaging NAV 11.1 using Composer DIFF files. We observed the Scheduler settings plist for users are stored in /Library/LaunchDaemons.
There are individual plist for different users in the
/Library/LaunchDaemons with the UID attached in the plist file name. We
have to add the scheduler settings to all users and futures users in the
package. Normally if the settings are stored in User Library Preferences
we have a loop script to add the plist in to all users and future users.
Since we have the scheduler plist files stores in LaunchDaemons with UID
attached to the file names, we are unable to find a way to add the
scheduler setting for existing and future users.
The plist in LaunchDaemons has the following key for the user settings.
Plist file name is like "com.symantec.Sched501-2.plist"
<key>UserName</key>
<string>admin</string>
Looking for a way to add scheduler settings to existing users and future users. Kindly suggest me.
Thanks & Regards,
Karthikeyan,
Posted on 07-14-2011 01:33 PM
this script will set a random time for scans etc. but you probably have all you need command wise here.
#!/usr/bin/perl -w
use strict;
use Getopt::Std;
use vars qw($opt_h $opt_t $opt_v);
(my $progname =$0) =~ s#.*/##;
$ENV{PATH} = '/bin:/usr/bin';
umask 0022;
my $schedtool = "/Library/Application Support/Symantec/Scheduler/SymSecondaryLaunch.app/Contents/symsched";
my $scanscheduled = 0;
my $updatescheduled = 0;
my $username;
my $hr = (int rand 10) + 7;
my $min = int rand 59;
my $time = sprintf("%2d:%2d", $hr, $min);
$username = $ENV{USER};
open SS, ""$schedtool" -u $username -l -U |" or die "$progname: $schedtool: $!
";
while (<SS>) {
$updatescheduled = 1 if (/^LiveUpdate/);
$scanscheduled = 1 if (/^VirusScan/);
}
unless ($updatescheduled) {
print "Update Schedule needs to be created
";
system("logger "$progname: \"$schedtool\" -u $username LiveUpdate \"Daily Update\" 1 1 -daily $time \"All Products\""");
system(""$schedtool" -u $username LiveUpdate "Daily Update" 1 1 -daily $time "All Products"");
}
$hr = (int rand 10) + 7;
$min = int rand 59;
my $day = int rand 28;
$time = sprintf("%2d:%2d", $hr, $min);
unless ($scanscheduled) {
print "Scan Schedule needs to be created
";
system("logger "$progname: \"$schedtool\" -u $username VirusScan \"Monthly Scan\" 1 1 Monthly $day $time \"/\" \"/UserData\""");
system(""$schedtool" -u $username VirusScan "Monthly Scan" 1 1 Monthly $day $time "/" "/UserData"");
}
exit 0;
--
Todd Ness
Technology Consultant/Non-Windows Services
Americas Regional Delivery Engineering
HP Enterprise Services