You've already forked crontab-ui
mirror of
https://github.com/alseambusher/crontab-ui.git
synced 2025-12-15 11:43:58 +08:00
take backup
This commit is contained in:
28
app.js
28
app.js
@@ -28,8 +28,9 @@ app.get(routes.root, function(req, res) {
|
||||
//crontab.create_new("/sbin/ping -c 1 192.168.0.1 > /dev/null", "* * * * *");
|
||||
crontab.crontabs( function(docs){
|
||||
res.render('index', {
|
||||
routes : routes,
|
||||
crontabs : JSON.stringify(docs)
|
||||
routes : JSON.stringify(routes),
|
||||
crontabs : JSON.stringify(docs),
|
||||
backups : crontab.get_backup_names()
|
||||
});
|
||||
});
|
||||
})
|
||||
@@ -46,6 +47,29 @@ app.post(routes.save, function(req, res) {
|
||||
res.end();
|
||||
})
|
||||
|
||||
app.post(routes.stop, function(req, res) {
|
||||
crontab.status(req.body._id, true);
|
||||
res.end();
|
||||
})
|
||||
|
||||
app.post(routes.start, function(req, res) {
|
||||
crontab.status(req.body._id, false);
|
||||
res.end();
|
||||
})
|
||||
|
||||
app.post(routes.remove, function(req, res) {
|
||||
crontab.remove(req.body._id);
|
||||
res.end();
|
||||
})
|
||||
app.get(routes.crontab, function(req, res) {
|
||||
crontab.set_crontab();
|
||||
res.end();
|
||||
})
|
||||
|
||||
app.get(routes.backup, function(req, res) {
|
||||
crontab.backup();
|
||||
res.end();
|
||||
})
|
||||
app.listen(app.get('port'), function() {
|
||||
console.log("Crontab UI is running at localhost:" + app.get('port'))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user