How do I schedule a robot to check a folder every 5 minutes?I need him to read this folder and get the .PDF files contained in it and add it to another system.Thank you in advance for your help.
My first idea would be a loop (https://robocorp.com/docs/robot-framework-for-rpa/how-to-use-for-loops), and inside the loop, a 5 minute sleep?
But I am new to this so not sure…
Yes, a for loop with a read and then a 5 minutes sleep
I would not bother with 5 minutes interval in robot. If you do that, your robot task probably never terminates and thus never generates reports.
Better if you implement the processing in robot, but call robot every X minutes with an external scheduler like for example cronjob or jenkins.
There’s also the possibility to use Robocorp Cloud for scheduling, depending on the type of task you’re going to build. https://robocorp.com/docs/product-manuals/robocorp-cloud/robocorp-cloud
I have a cron job in mac os that fills some data in the browser, it never executes the crontab, here I left my cron, I don’t know what the error is!
*/1 * * * * cd /Volumes/storage\ para\ mac\ os/robot\ framework/rpa\ library && robot libreryrpa.robot
two things I noticed in your post:
- the cd command is using windows style back slashes (
\) but you mention using a mac so you should probably switch them to forward slashes (
- After the && there is no path to the robot executable so this is probably the problem you are having
I suggest you try your cron job like this:
*/1 * * * * /path/to/robot/robot /Volumes/storage/para/mac/os/robot/framework/rpa/library/libreryrpa.robot
and see if that works better for you.