Call now to talk to an automation expert — (512) 345-2211

Knowledge Base

Enter search queries below or use the tag links to the right to browse the knowledge base by category (Show All Tags).

When using the CRON command I can only get the first scheduled event to happen. Why?

There are several reasons why you might see one event in your crontab file run, but not others.

Events scheduled at the same time

In Robo-FTP 3.7.x and earlier, you have to make sure that no two events are scheduled to run at the exact same time. Otherwise, only one of the events will fire.

Events overlap

In Robo-FTP 3.7.x and earlier, you have to make sure that no two events overlap. For example, if you have an event scheduled to fire at 7pm, and that script takes 15 minutes to run, and you also have an event scheduled to fire at 7:05pm, that second event won't fire. The second event will be missed because the first script will not yet have returned before 7:05pm.

Script changes working directory

If you are using Robo-FTP 3.7.x or earlier, the CRON command looks in the current working directory for the crontab file that contains the scheduling conditions. If Robo-FTP's current working folder was changed (via the WORKINGDIR script command) in the script file called as a result of the CRON event being triggered, then none of the subsequent jobs will fire. If you are using relative file names (e.g. in the master script or the "crontab.txt" file) this is likely to cause a failure. If you change the working folder in a called script, always restore the original folder before returning or use fully qualified file names (e.g., complete folder and file names) in all script commands.

Script exits

If you are using a basic script such as:

PERFORM %nextcmd
GOTO loop

and you have a crontab file something like this:

0 23 * * mon        CALL "Monday.s"
0 23 * * tue        CALL Tuesday.s"

What might happen is that the called script (e.g., "Monday.s") does not return because it ends with STOP or EXIT. Such commands stop Robo-FTP dead in its tracks. The proper command to use is RETURN to allow Robo-FTP to complete the scheduled job and return to wait for the next event.

NOTE: Robo-FTP 3.10.x and later includes a new, built-in scheduler that is easier to use and more powerful than the older CRON command. Go to the Schedule tab in the Configurator to use this new feature.

Article last updated: 2016-10-25

Tags: CRON, crontab.txt, scheduling, Robo-FTP

Need help figuring out where to start?

Our sales staff is available to answer product questions and help you determine if Robo-FTP is a good match for your project.

Call Now: (512) 345-2211