diff --git a/index.js b/index.js index be5b44b..f10e876 100644 --- a/index.js +++ b/index.js @@ -123,6 +123,28 @@ cron.schedule( } ); +cron.schedule( + "14-19 7 * * *", + async () => { + exec("sh /home/script/script3.sh", (error, stdout, stderr) => { + if (error) { + console.error(`Gagal menjalankan script antribgr1: ${error.message}`); + return; + } + + if (stderr) { + console.error(`Stderr antribgr1: ${stderr}`); + return; + } + + console.log(`Output antribgr1 : ${stdout}`); + }); + }, + { + timezone: "Asia/Jakarta", + } +); + app.use((req, res) => { res.json("What are you looking for?!"); });