Questions tagged [jobs]

A job is a process executing in the background, or scheduled for later execution. **DO NOT** use this tag for career, employment, or hiring practice questions, as these are off-topic!

A job in a batch processing system is a task scheduled for execution. For questions related to scheduling jobs, see .

In a Unix/Linux context, a job is a process or group of processes running in a terminal, which can be placed in the foreground or in the background. See . For questions about job control with a shell such as bash from a user's perspective, see the jobs and job-control tags on Unix Stack Exchange.

Note that questions related to jobs as in work, career are off-topic on Stack Overflow. Some questions about this topic are suitable for Workplace Stack Exchange; be sure to read the faq.

2834 questions
22
votes
10 answers

How to cancel queued job in Laravel or Redis

How can I browse all the pending jobs within my Redis queue so that I could cancel the Mailable that has a certain emailAddress-sendTime pair? I'm using Laravel 5.5 and have a Mailable that I'm using successfully as follows: $sendTime =…
Ryan
  • 22,332
  • 31
  • 176
  • 357
22
votes
3 answers

Why does running a background task over ssh fail if a pseudo-tty is allocated?

I've recently run into some slightly odd behaviour when running commands over ssh. I would be interested to hear any explanations for the behaviour below. Running ssh localhost 'touch foobar &' creates a file called foobar as expected: [bob@server…
21
votes
5 answers

Sidekiq retry count in job

Is there a way to get the retry count for the current job? I want the job to stop, not crash, after x retries. I would like to ask the retry count in the perform method so I could simply return if the retry count equals x. def perform(args) return…
Cimm
  • 4,653
  • 8
  • 40
  • 66
20
votes
1 answer

Why in kubernetes cron job two jobs might be created, or no job might be created?

In k8s Cron Job Limitations mentioned that there is no guarantee that a job will executed exactly once: A cron job creates a job object about once per execution time of its schedule. We say “about” because there are certain circumstances where …
radistao
  • 14,889
  • 11
  • 66
  • 92
20
votes
1 answer

Confusion over hadoop job tracker api

I'm try to collect some information from the job tracker. For starters I'd like to start with getting running jobs info such as job id or job name etc. But already stuck, here is what I've got (prints out job ids for currently running jobs): public…
Gandalf StormCrow
  • 25,788
  • 70
  • 174
  • 263
19
votes
5 answers

Are There Any Cron Jobs Alternative?

Cron Jobs are closed on my server and server admin doesn't accept open it. Because , cron jobs slowing server etc. So, i need an alternative. I have to run a php file (cron.php) every 2 minutes. So, how can i do this ?
Eray
  • 7,038
  • 16
  • 70
  • 120
19
votes
4 answers

Powershell - how to pre-evaluate variables in a scriptblock for Start-Job

I want to use background jobs in Powershell. How to make variables evaluated at the moment of ScriptBlock definition? $v1 = "123" $v2 = "asdf" $sb = { Write-Host "Values are: $v1, $v2" } $job = Start-Job -ScriptBlock $sb $job | Wait-Job |…
Ivan
  • 9,089
  • 4
  • 61
  • 74
17
votes
3 answers

How do I get tcsetpgrp() to work in C?

I'm trying to give a child process (via fork()) foreground access to the terminal. After I fork(), I run the following code in the child process: setpgid(0, 0); And: setpgid(child, child); In the parent process. This gives the child its own…
John Kurlak
  • 6,594
  • 7
  • 43
  • 59
17
votes
3 answers

Laravel Jobs Serialization of 'Closure' is not allowed

I would like to send Data to a NewsletterStore Job. But it's failing with the following error. Any suggestions? I also tried to remove the SerializesModels Models trait. Without any success. Error Exception Serialization of 'Closure' is not…
Stan Barrows
  • 873
  • 1
  • 12
  • 27
17
votes
3 answers

How to set a time limit for a Kubernetes job?

I'd like to launch a Kubernetes job and give it a fixed deadline to finish. If the pod is still running when the deadline comes, I'd like the job to automatically be killed. Does something like this exist? (At first I thought that the Job spec's…
Bosh
  • 8,138
  • 11
  • 51
  • 77
17
votes
2 answers

Avoid heroku server from sleeping

I got a website hosted on a Heroku server (i'm a new to Heroku btw), and as it's under the free package, it sleeps after 30m of inactivity, and to put it in action again when a user hits it, it takes around 7 secs to npm run start successfully. I'm…
Basim Hennawi
  • 2,651
  • 3
  • 19
  • 31
17
votes
6 answers

Jenkins delete builds older than latest 20 builds for all jobs

I am in the process of cleaning up Jenkins (it was setup incorrectly) and I need to delete builds that are older than the latest 20 builds for every job. Is there any way to automate this using a script or something? I found many solutions to delete…
Fadi
  • 1,329
  • 7
  • 22
  • 40
17
votes
5 answers

How terminate child processes when parent process terminated in C#

Task: Auto kill all child processes if parent process terminate. Parent procees can be terminated not only in correct way, but also by killing in ProcessExplorer, for example. How can I do it? Similar question in С topic advice to use Job objects.…
LionSoft
  • 1,469
  • 2
  • 15
  • 20
17
votes
3 answers

Android JobScheduler onStartJob called multiple times

The JobScheduler calls onStartJob() multiple times, although the job finished. Everything works fine, if I schedule one single job and wait until it has finished. However, if I schedule two or more jobs with different IDs at the same time, then…
vRallev
  • 4,982
  • 3
  • 31
  • 34
17
votes
2 answers

How to set to a QUARTZ JOB to start only when an another JOB finished, stopped?

I have a QUARTZ JOB which is starts every 10 minutes. If a JOB doesn't finish in 10 minutes, in the next 10th minute another JOB will start. What I want is: the next JOB (after every 10 minute) should start only, if the previous JOB has finished…
victorio
  • 6,224
  • 24
  • 77
  • 113