Part 2: Updating DDNS on EdgeRouter Lite Using Crontab

Since my first post on this subject, I found a better way of doing it.

There is a feature called task-scheduler, which seems to be a wrapper for cron. The benefit to using it, however, is that your commands get saved in /config which ensures that they get copied over during firmware upgrades.

As usual, Ubiquiti’s community forums were very helpful in figuring this out. This post got me started.

These commands should be all you need to setup the task-scheduler similarly to how I had cron setup in the first post.

configure
set system task-scheduler task ddnsupdate
set system task-scheduler task ddnsupdate crontab-spec '0 20 * * 0'
set system task-scheduler task ddnsupdate executable path '/config/scripts/'
commit
save

That’s it!

Bonus

If you noticed earlier, I moved the actual ddnsupdate script to /config/scripts/ which ensures that it gets copied after a firmware upgrade.

Also, you can check that those commands actually created the cronjob in /etc/cron.d/vyatta-crontab

### Added by /opt/vyatta/sbin/vyatta-update-crontab.pl ###
0 20 * * 0 root /config/scripts/ddnsupdate
This entry was posted in WPPC Networking Project and tagged , . Bookmark the permalink.

3 Responses to Part 2: Updating DDNS on EdgeRouter Lite Using Crontab

  1. Larry says:

    In your line for set system task-scheduler task ddnsupdate executable path you forgot to include the executable.

  2. Dwayne says:

    these two posts are super handy. I had another script that would drop off the cron scheduler after a firmware upgrade, this is a much more robust solution. thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.