Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

1000

May 24th, 2017 11:00

Question with how to set scheduled reports to run every other week.

Hello Community! 

I have a request to schedule a report to email out every other Tuesday.  When using the drop down options during Editing Scheduled Report, I do not see an option for this ability.  When going into advance, it is cron based scheduling, which doesn't step 2 weeks with built-in options.  I assumed that maybe after setting a schedule it would show up in crontab (so I could add a "test" statement), but I'm not finding the user that is doing this.  Leads me to believe it is a built-in scheduler.  I'm probably going to see if the advance options will take a "test" statement but seeing if anyone in the community has found this solution already.

TLDR : Any one have any experience with setting schedules to run every other week in SRM?

141 Posts

May 31st, 2017 11:00

Hi sooksun_cci,

I gave it a try, unfortunately it ended up with an invalid format error.

However a possible work around could be to create the scheduled report in the UI with the storage / email settings you need and save it as disabled. You can then trigger the scheduled report trough command line with the (APG/bin) manage-task.sh command.

You can use ./manage-tasks.sh list to get the details of the task and run it with ./manage-tasks.sh start <.taskID>.task

i.e.:

./manage-tasks.sh list

Scheduled Tasks List:

Id                                                                             Name                                           Category           Last Result  Current Status  Schedule

------------------------------------------------------------------------------ ---------------------------------------------- ------------------ ------------ --------------- ------------------

...

scheduled-reports/user1/2017-05-31_13-59-53_320.task                           Summary                                        report-scheduling  success      disabled        0 0 * * *

...

./manage-tasks.sh start scheduled-reports/user1/2017-05-31_13-59-53_320.task

hth

Regards,

Isaka

141 Posts

May 30th, 2017 11:00

Hi sooksun_cci,

Indeed, the cron setting is in the task-scheduler which triggers the reports.

I took a look at the actual config in the task-scheduler and unfortunately i don't see anyway of scheduling a report to run every other week.

Regards,

Isaka

14 Posts

May 30th, 2017 13:00

Thanks for the reply, Isaka.  Since the task-scheduler is cron like, do you know if you can pass calls to it like you can with built-in cron?  Like the test command so you can provide a condition.

Here is a sample of what I mean if this was straight crontab:

0 8 * * 6 test $((10#$(date +\%W)\%2)) -eq 1 && yourCommand

Thanks!

14 Posts

June 1st, 2017 07:00

Thanks a bunch Isaka!

It isn't built in, but at least now I can control it with cron.  Manually running the report works great. Just need to document and publish to our runbook. 

No Events found!

Top