Skip to content

Instantly share code, notes, and snippets.

View myshkin-uk's full-sized avatar

myshkin-uk myshkin-uk

View GitHub Profile
@myshkin-uk
myshkin-uk / show-cron-jobs.sh
Last active July 10, 2023 22:00
A bash script to list all cron tasks on a computer.
#!/bin/bash
# This script is designed to work only with recent bash implementations, not busybox/ash/dash etc...
# BEWARE - THIS IS SYMLINKED TO FROM THE NETRIX REPO ON DGC'S DESKTOP
# IF YOU EDIT IT THERE IT ALSO CHANGES THE MASTER ONE
# @FIXME DGC 6-May-2022
# This script has a large issue, which I have failed to notice ( or to fix ) earlier.
# It does a very bad job of labelling hourly/daily etc jobs with an 'execution time.
#
@myshkin-uk
myshkin-uk / script-start.inc.sh
Created March 1, 2019 18:02
Wind up and point all the optional safety checks which bash offers for scripts
Usage - include this script before doing serious work in another script.
you will need to leave your script using do_exit, not plain old exit - because bash double-uses exit as a way of flagging faults.
# No shebang because we are included in another sh file
# Files which include this one MUST use bash, since we use the 'source' command below.
# @FIXME DGC 16-Aug-2016
# I'm not clear why this script doesn't use a guard variable as per the coding standard.