
On 18/12/2020 23.21, Marco Calistri wrote:
Il 18/12/20 16:40, Brian Reichert ha scritto:
Below is the signature generated by script I add into the cron job: Try running your script with s cleared environment and a new non-login shell:
env - /bin/sh /etc/cron.hourly/myjob
You could use /bin/bash. Why sh? Do the change in your script, too.
I've not understood what you mean with "new non-login shell".
Google "what is a login shell in linux?" A login shell is a shell given to a user upon login into their user account. ... The general cases for having a login shell include: Accessing your computer remotely using ssh. Simulating an initial login shell with bash -l or sh -l. Simulating an initial root login shell with sudo -i. help.gnome.org › users › stable › pref-login-shell.html.en Login shells <https://help.gnome.org/users/gnome-terminal/stable/pref-login-shell.html.en> Google "what is a non-login shell in linux?" When a shell runs a script or a command passed on its command line, it's a non-interactive, non-login shell. Such shells run all the time: it's very common that when a program calls another program, it really runs a tiny script in a shell to invoke that other program. unix.stackexchange.com › questions › difference-between.. Difference between Login Shell and Non-Login Shell? - Unix ... <https://unix.stackexchange.com/questions/38175/difference-between-login-shell-and-non-login-shell>
Have I to found out a system user which has not a login shell?
Or it is sufficient I simply run such command sequence on my own user shell?
But the point is how to force cron to not trim out a part of the text I expect to write in the text file.
Precisely. The idea is to run the script in the same environment cron will use, to find out what the problem is. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)