Skip to content

Add anacronjobs plugins (unix)#1872

Open
william-billaud wants to merge 11 commits into
fox-it:mainfrom
william-billaud:anacronjob
Open

Add anacronjobs plugins (unix)#1872
william-billaud wants to merge 11 commits into
fox-it:mainfrom
william-billaud:anacronjob

Conversation

@william-billaud

@william-billaud william-billaud commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Add anacronjobs plugins (unix)

Currently anacrontab are processed as crontab, but anacron use a different format. This PR add a proper parser for anacrontab entries.

Proposed Changes

  • Create a dedicated anacrontab plugin

  • One main difference with cron, is the presence of timestamp files in the /var/spool/anacron directory. This plugin try to Extract the last execution date from this file. If stored ts date is the same day as the last file modification date, use the file last modification date as "last exec" date, if not just retrieve date from stored timestamp, or none if file is not available.

  • As Anacron often use run-parts, add a specific logic to yield script referenced by run-parts, if those scripts are available.

  • Remove the anacrontab path from cronjob plugin + use the get_path function, to make this plugin works with --direct

  • fixes Anacrontab is not properly processed #1543

Checklist

  • PR Title is descriptive of the changes
  • The description is descriptive of the changes
  • Tests are included and pass
  • Closes related issue number

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.21429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.07%. Comparing base (28082eb) to head (df7b5dc).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
dissect/target/plugins/os/unix/anacronjobs.py 98.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1872      +/-   ##
==========================================
+ Coverage   81.05%   81.07%   +0.02%     
==========================================
  Files         404      405       +1     
  Lines       36511    36564      +53     
==========================================
+ Hits        29594    29646      +52     
- Misses       6917     6918       +1     
Flag Coverage Δ
unittests 81.07% <98.21%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq

codspeed-hq Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 32 untouched benchmarks


Comparing william-billaud:anacronjob (df7b5dc) with main (28082eb)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anacrontab is not properly processed

1 participant