29 lines
736 B
Perl
Executable File
29 lines
736 B
Perl
Executable File
#!/usr/bin/perl
|
|
#################################################################################### telemetry setup (mwx'2020)
|
|
|
|
&setupcron();
|
|
|
|
|
|
####################################################################################################### SUPPORT
|
|
|
|
sub setupcron() {
|
|
open(CRON,"crontab -l |");
|
|
while(<CRON>) {
|
|
chomp();
|
|
push(@CRON,$_) if (!/\/db\/bin\/telemetry/);
|
|
}
|
|
|
|
push(@CRON,"*/5 * * * * /db/bin/telemetry > /dev/null 2>&1");
|
|
|
|
open(OUT,"> /tmp/cron.$$");
|
|
for (@CRON) {
|
|
print OUT "$_\n";
|
|
}
|
|
close(OUT);
|
|
system("/usr/bin/crontab /tmp/cron.$$");
|
|
system("rm -f /tmp/cron.$$");
|
|
}
|
|
|
|
|
|
########################################################################################################### END
|