Ostatnio aktywny 1746424450

shutdown-cron.md Surowy

Script to shutdown my cloud server on the 15th of the month using cron

First, install cron

sudo apt update

sudo apt install cron

Next enable the cron

sudo systemctl enable cron

Use crontab to run the scripts

I'll be putting a couple of cron jobs on the server to run at specific times. We can do that with editing the crontab file with:

sudo nano /etc/crontab

[!NOTE]
This only works on Linux systems

The first cron job to run

SHELL=/bin/bash

0 0 15 * *