Reboot and check file system as scheduled task

I would like to set up a task to restart and check the file system of my IPFire once per week, or once per month. What is the correct procedure for setting that up? Connection Scheduler only has a “reboot” option, I want to check the file system.

Is this done with a cron job, and if so, what’s the shell command to set it up like the GUI has it?

Chris

A cron job would be the best way to do that. IPFire uses fcron. However the fcrontab is likely to be overwritten when aa CU is carried out if fcron is updated.
See this wiki link for how to create a separate user with its own fcrontab that will not be overwritten.
https://wiki.ipfire.org/pkgs/fcron

1 Like

If you do not want a very specific time, it might be easier to place the script in the /etc/fcron.weekly or the /etc/fcron.monthly directory.

Weekly → place script in /etc/fcron.weekly directory

At 02:47 on Monday. See: https://crontab.guru/#47_2_*_*_1

This is already part of fcrontab.

Monthly → place script in /etc/fcron.monthly directory

At 03:52 on 1st day of the month. See: https://crontab.guru/#52_3_1_*_*

This is already part of fcrontab.



EDIT: This should be the right command:

/sbin/shutdown -F -r now

but you will need to add it to a small script.

4 Likes