Skip to content

Instantly share code, notes, and snippets.

@hashfii
Last active August 9, 2024 07:04
Show Gist options
  • Save hashfii/64bdcbaf1f1518a60f1bae833716b0a7 to your computer and use it in GitHub Desktop.
Save hashfii/64bdcbaf1f1518a60f1bae833716b0a7 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Script untuk menghapus semua cron job yang ada dan menambahkan yang baru
# Definisikan cron job yang akan ditambahkan
cron_job_1="0 0 * * * sudo reboot"
# Hapus semua cron job yang ada
crontab -r
# Tambahkan cron job baru
(echo "$cron_job_1" ; echo "$cron_job_2" ; echo "$cron_job_3") | crontab -
echo "Crontab telah diupdate."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment