[SOLVED] pct command in crontab script

_Ernesto_

Member
Dec 12, 2019
2
0
21
41
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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!