dachev / node-crontab

A module for creating, reading, updating, and deleting system cron jobs
189 stars 35 forks source link

does it work on mac os x? #30

Closed alexey-sh closed 6 years ago

alexey-sh commented 6 years ago

I've created job successfully via command cron.create(sysCommand, '0 0/12 * * *', uuid); but crontab -l show me nothing

dachev commented 6 years ago

@alexey-sh Did you save your changes?

alexey-sh commented 6 years ago

@dachev

require('crontab').load(function(err, crontab) {

    crontab.create('ls -lh', '0 0/12 * * *', 'uuid');
    crontab.save(function(err, crontab) {
        console.log('saved')
    });
});

in terminal I see only empty line:

$ node cron.js 
saved
$ crontab -l
dachev commented 6 years ago

@alexey-sh The 0/12 token is non-standard and fails to parse. At the library level this is indicated by crontab.create returning a null. If you can point me to some official doc for a cron version that supports this syntax I am willing to add support.