I'm trying to have rex fiddle with crontabs and ran into an issue when
getting started: crontab -l is returning status 1 for there not being a
crontab, which causes rex to abort. It kinda defeats the purpose of Rex
if you have to manually create a crontab before putting something in it,
and the cron add => "root" does not work to create the initial crontab.
I would also like to be able to manage /etc/crontab as well...
task "listcron", sub {
my @crons = cron list => "root";
print Dumper(\@crons);
};
[2018-03-02 14:02:49] ERROR - 1 out of 1 task(s) failed:
[2018-03-02 14:02:49] ERROR - listcron failed on
zmail04-astore01.peak.org
[2018-03-02 14:02:49] ERROR - Error during `i_run` at
/usr/local/share/perl5/Rex/Helper/Run.pm line 116.
[2018-03-02 14:02:49] ERROR -
Rex::Helper::Run::i_run('crontab -l 2> /dev/null') called at
/usr/local/share/perl5/Rex/Cron/Base.pm line 199
[2018-03-02 14:02:49] ERROR -
Rex::Cron::Base::read_user_cron('Rex::Cron::Linux=HASH(0x234eaa8)', 'root')
called at /usr/local/share/perl5/Rex/Commands/Cron.pm line 226
[2018-03-02 14:02:49] ERROR -
Rex::Commands::Cron::cron('list', 'root') called at
/loader/0x17cae90/__Rexfile__.pm line 163
[2018-03-02 14:02:49] ERROR -
Rex::CLI::__ANON__('HASH(0x2042fd0)', 'ARRAY(0x2042fa0)') called at
/usr/local/share/perl5/Rex/Interface/Executor/Default.pm line 61
[2018-03-02 14:02:49] ERROR - eval {...} called at
/usr/local/share/perl5/Rex/Interface/Executor/Default.pm line 43
[2018-03-02 14:02:49] ERROR -
Rex::Interface::Executor::Default::exec('Rex::Interface::Executor::Default=HASH(0x1fb9168)',
'HASH(0x2042fd0)', 'ARRAY(0x2042fa0)') called at
/usr/local/share/perl5/Rex/Task.pm line 882
[2018-03-02 14:02:49] ERROR - eval {...} called at
/usr/local/share/perl5/Rex/Task.pm line 886
[2018-03-02 14:02:49] ERROR -
Rex::Task::run('Rex::Task=HASH(0x2042d30)',
'Rex::Group::Entry::Server=HASH(0xcb9b50)', 'in_transaction', 0, 'params',
undef, 'args', undef) called at /usr/local/share/perl5/Rex/TaskList/Base.pm
line 337
[2018-03-02 14:02:49] ERROR - eval {...} called at
/usr/local/share/perl5/Rex/TaskList/Base.pm line 336
[2018-03-02 14:02:49] ERROR -
Rex::TaskList::Base::__ANON__('Rex::Fork::Task=HASH(0x1aaee30)') called at
/usr/local/share/perl5/Rex/Fork/Task.pm line 34
[2018-03-02 14:02:49] ERROR -
Rex::Fork::Task::start('Rex::Fork::Task=HASH(0x1aaee30)') called at
/usr/local/share/perl5/Rex/Fork/Manager.pm line 37
[2018-03-02 14:02:49] ERROR -
Rex::Fork::Manager::add('Rex::Fork::Manager=HASH(0x1668408)',
'CODE(0x1954670)') called at /usr/local/share/perl5/Rex/TaskList/Base.pm line
318
[2018-03-02 14:02:49] ERROR -
Rex::TaskList::Base::run('Rex::TaskList::Base=HASH(0xbe34c0)',
'Rex::Task=HASH(0x1fb9390)') called at /usr/local/share/perl5/Rex/TaskList.pm
line 62
[2018-03-02 14:02:49] ERROR -
Rex::TaskList::run('Rex::TaskList', 'Rex::Task=HASH(0x1fb9390)') called at
/usr/local/share/perl5/Rex/RunList.pm line 69
[2018-03-02 14:02:49] ERROR -
Rex::RunList::run_tasks('Rex::RunList=HASH(0x11a4618)') called at
/usr/local/share/perl5/Rex/CLI.pm line 380
[2018-03-02 14:02:49] ERROR - eval {...} called at
/usr/local/share/perl5/Rex/CLI.pm line 380
[2018-03-02 14:02:49] ERROR -
Rex::CLI::__run__('Rex::CLI=HASH(0xb87f40)') called at /usr/local/bin/rex
line 24
<zmail04-astore01.peak.org> [121] # crontab -l
no crontab for root
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature