Crontab enviromental variables - environment-variables

Struggling a bit on this...
I'm using crontab for a lot of todo list management:
Here's a snippet of my crontab...
$TASK=/home/pgrads/joseph/emailAnalysis/single
0,30 * * * * ~/emailAnalysis/python/script.py
15,45 * * * * $TASK/task.sh "foo"
10,40 * * * * /home/pgrads/joseph/emailAnalysis/single/task.sh "bar"
My problem is that the 'foo' task is not triggering - I get the error "/bin/sh: /task.sh: No such file or directory".
A few googles haven't got me very far - mainly they just give me variations on the man page... :s any ideas?

Remove the $ from your first line:
TASK=/home/pgrads/joseph/emailAnalysis/single

Related

Old version of job keeps ressurecting after deletion on SideKiq

I have one job that keeps running here is the result from Sidekiq::Cron::Job.all.to_yaml my problem is this code hasn't been used in months and i can't delete it for the life of me
I use the SideKiq web ui gem to delete all dead and retry versions of this and have tried using kill as well but nothing is working
- !ruby/object:Sidekiq::Cron::Job
fetch_missing_args: false
name: bundle_resolve_job
cron: 7,27,47 * * * *
description: ''
klass: Jobs::Order::Bundle::ResolvePayingJob
status: enabled
last_enqueue_time: 2022-07-26 09:27:42.000000000 Z
args: []
active_job: false
active_job_queue_name_prefix: ''
active_job_queue_name_delimiter: ''
message: '{"retry":true,"queue":"general","class":"Jobs::Order::Bundle::ResolvePayingJob","args":[]}'
queue: general
queue_name_with_prefix: general
and this is config/schedule.yml
global_parcel_resolve_job:
class: "Jobs::Global::Parcel::ResolvePayingJob"
cron: "7,27,47 * * * *"
queue: general
how can I permanently remove this job? that keeps using the old version of the code
Create an empty version of the job class. Let it "succeed".

Parameterized Scheduler with File parameters - Jenkins

I pass multiple files as parameters to my jenkins job. I have scheduled the job to run at regular intervals. I have installed the parameterized-scheduler plugin but I am unable to figure out the syntax for scheduling the job with the files as parameters.
If my file names are a.js, b.js, c.js. What would be the syntax for me to use the parameterized scheduler?
Is there another approach to solving this issue?
Syntax for parametrized scheduler:
*/2 * * * * %FILE=a.js
1-59/2 * * * * %FILE=b.js
* * * * * %FILE=c.js
Here, FILE is string parameter which accepts the name of file.
Note: Please change the interval accordingly.
I could not find an answer to this question although I have found a better approach.
The right way to solve this problem is to upload the files on a cloud repository that can be downloaded/cloned to the workspace during a build and then use the files.
So, I have uploaded the files to a github repo which I am cloning during a build and using them.

Jenkins Build periodically with parameters doesn't work

I'm using Jenkins 2.46.2 version. I have installed Parameterized Scheduler plugin to trigger the build periodically with different parameter.
But it fails to trigger the build at scheduled time.
You have a problem with the ";" on parameters.
you have to insert space after each parameter, for example:
H/2 * * * * % EndMarket=can ;GitBranch=DevelopmantBranch
try without spaces between params, like:
0 8 * * * % base_url=https://www.example.com;suite_type=Regression
I installed the plugin on Jenkins 2.67, and it works. I had the same problem with builds failing to trigger with earlier version of Jenkins.
in my case, my parameter is Choice Parameter, so if I set the scheduler below and 'valueabc' is not in the list of choice, it will fail to start
H/15 * * * * %name=valueabc

How to make Rufus-scheduler reflect file changes

I'm using Rufus-scheduler gem in my ROR application to send emails in the background. My setup is like:
# config/initializers/rufus_scheduler.rb
scheduler = Rufus::Scheduler.new(lockfile: '.rufus-scheduler.lock')
scheduler.cron '0 2 * * fri' do
UserMailer.send_some_emails
end
Any changes I make in the .send_some_email class method isn't reflected in the Rufus-scheduler task, how can I fix this? I don't want to restart the server every time I make a change!
Let's assume UserMailer.send_some_emails is defined in whatever/user_mailer.rb
scheduler = Rufus::Scheduler.new(:lockfile => '.rufus-scheduler.lock')
scheduler.cron '0 2 * * fri' do
load 'whatever/user_mailer.rb'
UserMailer.send_some_emails
end

where to set VALUE SIZE to more than 20MB in couchbase source code?

This question was asked earlier here
But didn't mention in which file and what constant, we need to change this limit.
I found few checks in test code but not in source code
ep-engine/ep_testsuite.cc:
rv = h1->allocate(h, NULL, &it, "key", 3, 20 * 1024 * 1024, 0, 0);
memcachetest/main.c: if (size > 1024 * 1024 *20) {
Can you please help me here.
It's hardcoded in the configuration.json file in the ep-engine project under the variable name max_item_size. You could modify it here and build the project or you can also specify a different value on the command line when starting memcached. For example if you just wanted to run the our memcached without all of the cluster management stuff you can run:
./memcached -E (path to ep-engine lib 'ep.so') -e max_item_size=your_size

Resources