Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need cronjob syntax to schedule job for every 2 week(biweekly).
for example, suppose i executed job today(18 Nov) then next job should execute on 2 Dec on 10 AM.
I tried with below syntax but does not work out.
note: running on ubuntu system.
i think you will need to cron it weekly and handle the bi-weekly logic in the program being run.
i would have it touch a file when it ends and create an if statement to check for the existence of said file and if it does exist then delete it and end; else continue.
It would be overkill if this is all you need to do. But if you find yourself doing this sort of thing a lot, and it's appropriate for your environment, you might be interested in remind. It has an entire language built for scheduling things, and you can view reminders as a calendar using wyrd. It can also execute arbitrary scripts instead of reminding you of things, though I'm not sure I'd give it root privileges. Here's an example from the man page:
For example, suppose you get paid every second Wednesday, and your last payday was Wednesday,28 October, 1992. You can use:
REM 28 Oct 1992 *14 MSG Payday
Also, anacron and (I would assume) systemd timers could be used for this.
Last edited by crazy-yiuf; 11-18-2016 at 12:44 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.