package ONO::ToolBox::Cron;
################################################################################
# COPYRIGHT / LICENSE #
################################################################################
#
# This file is part of the ONO Software Project.
#
# Copyright (C) 2000-2025 Jos KIRPS [ www.kirps.com | jos_AT_kirps_DOT_com ]
# and The Joopita Project [ www.joopita.org | contact_AT_joopita_DOT_com ]
#
# This file, as well as other parts of the ONO Software Project or related
# elements, are FREE SOFTWARE available under the ARTISTIC LICENSE 2.0.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# For the full license, see /ono/osr/license/LICENSE.txt, or write to
# jos_AT_kirps_DOT_com or contact_AT_joopita_DOT_com.
#
################################################################################
# END OF COPYRIGHT / LICENSE, HERE COMES THE CODE ... #
################################################################################
use strict;
use ONO::Lib::DateTime::ToolBox;
###############################################################################
# ONO
###############################################################################
sub input {
#: Input module for cron scripts located in /cgi-bin/local/perl/my_project/cron,
#: used by the default ONO cron.pl script for example.
my $path = $_[1];
$path =~ s~/cgi-bin/local/perl/(.*?)/cron~~;
my $project = $1;
my @args = @ARGV;
my $switches;
if ($ARGV[0] =~ /^-/) {
$switches = $ARGV[0];
$switches =~ s~[^A-Za-z0-9]~~g;
shift @args;
}
my %vars;
$vars{'path'} = $path;
my %time;
(
$time{'sec'},
$time{'min'},
$time{'hour'},
$time{'mday'},
$time{'mon'},
$time{'year'},
$time{'wday'},
$time{'yday'},
$time{'isdst'},
) = ONO::Lib::DateTime::ToolBox->get;
$time{'eu'} = qq~$time{'mday'}/$time{'mon'}/$time{'year'} $time{'hour'}:$time{'min'}:$time{'sec'}~;
$time{'us'} = qq~$time{'mon'}/$time{'mday'}/$time{'year'} $time{'hour'}:$time{'min'}:$time{'sec'}~;
return ($path,$project,$switches,\@args,\%vars,\%time);
}
sub exec {
# DEPRECATED
return 1;
}
###############################################################################
# end of script
###############################################################################
1;
__END__