[{"data":1,"prerenderedAt":223,"buildId":224},["ShallowReactive",2],{"docs:\u002Fguide\u002Fnight":3},{"page":4,"section":16,"document":17,"credits":10,"prev":215,"next":219},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"night","\u002Fguide\u002Fnight","guide\u002Fnight.md","Night queue","What happens to a job the kernel killed twice for memory, and how to list, accept, reject and run the jobs queued for the night.",null,[],"i-lucide-moon","article",true,6,"guide",{"nodes":18,"toc":211},[19,28,36,39,63,73,79,150,164],[20,21,22,23,27],"p",{},"A job that needs more memory than the machine has while other jobs run would fail for a reason that is not its own. fleetjobs retries it once when memory frees up. When the retry is killed too, or no memory frees up in time, the job goes to the night queue and ",[24,25,26],"code",{},"heavy"," returns exit 137 with a message that names the job.",[29,30,35],"h2",{"id":31,"anchor":32},"run-it",{"label":33,"icon":34},"Section titled \"Run it\"","#","Run it",[20,37,38],{},"A timer runs the queue at 02:30. Put this in a systemd user timer, or any scheduler you use:",[40,41,45],"pre",{"language":42,"frame":43,"class":44,"wrap":14},"sh","terminal","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,46,48],{"class":47},"language-sh",[49,50,53,56,60],"span",{"class":51,"style":52},"line","display: inline",[49,54,26],{"style":55},"color:#953800;--shiki-dark:#FFA657",[49,57,59],{"style":58},"color:#0A3069;--shiki-dark:#A5D6FF"," night",[49,61,62],{"style":58}," run",[20,64,65,66,68,69,72],{},"It runs each queued or accepted job in order, in its working directory, as a ",[24,67,26],{}," of its own with ",[24,70,71],{},"HEAVY_NIGHT_RUN=1",", so a job killed again is not queued again. Each run keeps its output. A job whose working directory is gone is skipped. A job folder is forgotten 14 days after its last change.",[29,74,78],{"id":75,"anchor":76},"review-it",{"label":77,"icon":34},"Section titled \"Review it\"","Review it",[40,80,81],{"language":42,"frame":43,"class":44,"wrap":14},[24,82,83,92,93,92,116,92,133],{"class":47},[49,84,85,87,89],{"class":51,"style":52},[49,86,26],{"style":55},[49,88,59],{"style":58},[49,90,91],{"style":58}," list","\n",[49,94,95,97,99,102,106,109,113],{"class":51,"style":52},[49,96,26],{"style":55},[49,98,59],{"style":58},[49,100,101],{"style":58}," show",[49,103,105],{"style":104},"color:#CF222E;--shiki-dark:#FF7B72"," \u003C",[49,107,108],{"style":58},"i",[49,110,112],{"style":111},"color:#1F2328;--shiki-dark:#E6EDF3","d",[49,114,115],{"style":104},">",[49,117,118,120,122,125,127,129,131],{"class":51,"style":52},[49,119,26],{"style":55},[49,121,59],{"style":58},[49,123,124],{"style":58}," accept",[49,126,105],{"style":104},[49,128,108],{"style":58},[49,130,112],{"style":111},[49,132,115],{"style":104},[49,134,135,137,139,142,144,146,148],{"class":51,"style":52},[49,136,26],{"style":55},[49,138,59],{"style":58},[49,140,141],{"style":58}," reject",[49,143,105],{"style":104},[49,145,108],{"style":58},[49,147,112],{"style":111},[49,149,115],{"style":104},[20,151,152,155,156,159,160,163],{},[24,153,154],{},"list"," prints one line for each job: its id, state, when it was queued, its folder and its command. ",[24,157,158],{},"show"," prints its state line and the last 60 lines of its output. A queued job runs unless you reject it; ",[24,161,162],{},"accept"," marks it as seen, and a rejected job stays out of the run. Neither changes a job that already ran.",[20,165,166,167,170,171,174,175,178,179,182,183,182,186,182,189,182,192,182,195,182,198,182,201,182,204,174,207,210],{},"The jobs are folders in the store, ",[24,168,169],{},"night\u002F\u003Cid>\u002F",", with ",[24,172,173],{},"entry.json"," and ",[24,176,177],{},"out",". The entry keeps the job's command and a few variables from its environment: ",[24,180,181],{},"PATH",", ",[24,184,185],{},"LANG",[24,187,188],{},"LC_*",[24,190,191],{},"NODE_OPTIONS",[24,193,194],{},"NODE_ENV",[24,196,197],{},"CI",[24,199,200],{},"VITEST_MAX_WORKERS",[24,202,203],{},"COREPACK_*",[24,205,206],{},"PNPM_HOME",[24,208,209],{},"HEAVY_*",".",[212,214],{"id":31,"depth":213,"text":35},2,{"id":75,"depth":213,"text":78},{"path":216,"title":217,"description":218},"\u002Fguide\u002Ftrust","Trust","How fleetjobs decides whether to believe a result from a remote host or run the command again here, and what the trust table keeps.",{"path":220,"title":221,"description":222},"\u002Fguide\u002Fmigrating","Migrating from the bash heavy","What changes for agents, scripts and config when fleetjobs replaces the bash heavy script, and how to compare the two on your own logs.",1796530822164,"9e7c308e-a25b-413c-bd8b-9a1122ddc1d4"]