[SOLVED] pct command in crontab script

_Ernesto_

Active Member
Dec 12, 2019
2
0
41
42
Hi, I have one question...
Why pct commands (list, exec, push, etc...) work fine if I run script manually, but don't work if script is lauched by crontab or by another script?
How can I resolve this problem? (All the script are executable).

e.g. "pct list | grep fileserver > /home/user/filetxt" is a part of script "pippo.sh" if I run manually "bash pippo.sh" filetxt contains the result of grep, but if "pippo.sh" is launched by crontab o by another script (e.g. pluto.sh that contains the instruction "bash pippo.sh") filetxt is empty.

Thanks in advance.
p.s. My PVE is 5.4.13
 
hi,

are you using the full path /usr/sbin/pct?
are you calling it with the right permissions? (root or sudo)
 
  • Like
Reactions: yassirh
Hi, thanks for your fast replay.
No, I was using pct, not ist full path.
With full path all work.
Bye,
 
awesome.

you can mark the thread as [SOLVED], so others know what to expect.