fusioninventory-agent icon indicating copy to clipboard operation
fusioninventory-agent copied to clipboard

[wip] Inventory Linux and Windows crontasks

Open ddurieux opened this issue 4 years ago • 3 comments

ddurieux avatar Feb 23 '21 10:02 ddurieux

Hello, is this still a work in progress or is there any other way to retrieve crontabs ?

Thanks in advance ^^

hugotomasi avatar May 11 '22 15:05 hugotomasi

It will be integrated in June for the version 2.7 ;)

ddurieux avatar May 11 '22 15:05 ddurieux

Sorry if I'm a bit late here, but you're mixing directories with different kind of content here.

Those directories contains configuration files for cron daemon, defining cron tasks:

  • /etc/cron.d
  • /var/spool/cron
  • /var/spool/cron/crontabs

Those directories contains scripts:

  • /etc/cron.hourly
  • /etc/cron.daily
  • /etc/cron.weekly
  • /etc/cron.monthly

Those scripts are actually executed by a crontab entry generally defined in /etc/crontab or /etc/anacrontab, such as: 01 * * * * root nice -n 19 run-parts --report /etc/cron.hourly 02 4 * * * root nice -n 19 run-parts --report /etc/cron.daily 22 4 * * 0 root nice -n 19 run-parts --report /etc/cron.weekly 42 4 1 * * root nice -n 19 run-parts --report /etc/cron.monthly

If you want to enumerate cron tasks stricto senso, you should not include the content of the last directory group. If you want to enumerate everything executed by cron, which is different, you should make a difference between a task (ie, run-parts executed every hour) and the command executed by this task (ie, the list of scripts present in /etc/cron.hourly)/

guillomovitch avatar May 31 '22 16:05 guillomovitch