This commit is contained in:
teddys48
2025-10-20 14:03:32 +07:00
parent 19816cdad1
commit de7fc52b67

102
index.js
View File

@@ -43,108 +43,6 @@ cron.schedule(
} }
); );
cron.schedule(
"* * * * *",
async () => {
exec("sh /home/script/script.sh", (error, stdout, stderr) => {
if (error) {
console.error(
`Gagal menjalankan script Antrisimatupang : ${error.message}`
);
return;
}
if (stderr) {
console.error(`Stderr Antrisimatupang : ${stderr}`);
return;
}
console.log(`Output Antrisimatupang: ${stdout}`);
});
exec("sh /home/script/script2.sh", (error, stdout, stderr) => {
if (error) {
console.error(
`Gagal menjalankan script antributikemas : ${error.message}`
);
return;
}
if (stderr) {
console.error(`Stderr antributikemas : ${stderr}`);
return;
}
console.log(`Output antributikemas: ${stdout}`);
});
},
{
timezone: "Asia/Jakarta",
}
);
cron.schedule(
"0-5 15 * * *",
async () => {
exec("sh /home/script/script.sh", (error, stdout, stderr) => {
if (error) {
console.error(
`Gagal menjalankan script antrisimatupang: ${error.message}`
);
return;
}
if (stderr) {
console.error(`Stderr antrisimatupang: ${stderr}`);
return;
}
console.log(`Output antrisimatupang : ${stdout}`);
});
exec("sh /home/script/script2.sh", (error, stdout, stderr) => {
if (error) {
console.error(
`Gagal menjalankan script antributikemas: ${error.message}`
);
return;
}
if (stderr) {
console.error(`Stderr antributikemas : ${stderr}`);
return;
}
console.log(`Output antributikemas : ${stdout}`);
});
},
{
timezone: "Asia/Jakarta",
}
);
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) => { app.use((req, res) => {
res.json("What are you looking for?!"); res.json("What are you looking for?!");
}); });