crontab-ui/restore.js

19 lines
454 B
JavaScript
Raw Normal View History

2015-06-13 02:53:13 +00:00
//load database
var Datastore = require('nedb');
var exec = require('child_process').exec;
var fs = require('fs');
exports.crontabs = function(db_name, callback){
var db = new Datastore({ filename: __dirname + '/crontabs/' + db_name });
db.loadDatabase(function (err) {
});
2015-06-13 20:38:20 +00:00
db.find({}).sort({ created: -1 }).exec(function(err, docs){
2015-06-13 02:53:13 +00:00
callback(docs);
});
2016-09-01 18:10:11 +00:00
};
2015-06-13 02:53:13 +00:00
exports.delete = function(db_name){
fs.unlink(__dirname + '/crontabs/' + db_name);
2016-09-01 18:10:11 +00:00
};