Hi, Rui. I just tested ir with the 'L' CRON keyword and it is in fact as you said. It's not valid.
But you get get around it by just getting the day number yourself and just concatenate the string. For instance:
var day = DateTime.DaysInMonth(DateTime.UtcNow.Year,2).ToString();
I tested it with minute incrementation only as it would take too long to wait the end of each month to test it. So, this was it:
private static string LigacaoBD = @"*Your Data Source*";
private static int number = 0;
private static string id = "";
var server = new BackgroundJobServer();
BackgroundJob.Enqueue(() => test());
public string Increment()
cron = "*/" + number + " * * * *";
public void test()
using (var connection = JobStorage.Current.GetConnection())
foreach (var recurringJob in connection.GetRecurringJobs())
recurringJob.Cron = Increment();
RecurringJob.AddOrUpdate(() => test(), cron);
So, bascially, you have to "manually" look for the cron of the recurring job and order a change (otherwise it won't update) and send it to a string. And then just use that string as the cron.
I tested it with minute incrementation, but you can replace that with the line I showed at the beginning of the about, about the days in month.
Hope it helped.