<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<br>
<br>
<div class="moz-cite-prefix">On 26/09/2023 08:33, lejeczek via
ubuntu-users wrote:<br>
</div>
<blockquote type="cite"
cite="mid:5094277e-26a1-4300-0b40-bf17b7c028d5@yahoo.co.uk">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<br>
<br>
<div class="moz-cite-prefix">On 24/09/2023 18:44, lejeczek via
ubuntu-users wrote:<br>
</div>
<blockquote type="cite"
cite="mid:16ef6878-33a6-71c2-0721-d507a1b04a03@yahoo.co.uk">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<font size="2"><font face="Courier 10 Pitch">Hi guys.<br>
<br>
I have this <br>
<br>
*/1 * * * * { [[ $(/usr/bin/sudo -u postgres /usr/bin/psql
--quiet --port=5433 -x -c 'select state from
pg_stat_replication;' | grep streaming > /dev/null)$? -eq
0 ]] && /usr/bin/touch /tmp/pgSQL-5433.isMaster ||
rm -f /tmp/pgSQL-5433.isMaster; }<br>
<br>
which in regular shell session touches the file, but in the
cron file gets removed, the opposite & actually the only
outcome, regardless of whether the test is true or false.<br>
What is going on there?<br>
many thanks, L.<br>
</font></font> <br>
<fieldset class="moz-mime-attachment-header"></fieldset>
</blockquote>
I appreciate all the feedback, I do, however -- on purpose or not
--- everybody seems to have ignored my second, equally important
point.<br>
Whether<br>
if ..<br>
[ ..<br>
[[ ..<br>
and I tried them all, outside of _cron_ the same command line,
copy&paste, works as expected, tests works as expected.<br>
<br>
<br>
</blockquote>
ough, okey, seems that I was missing:<br>
SHELL=/usr/bin/bash<br>
if I was to expect Ubuntu's _crond_ to behave more like defaults in
RHEL/Centos.<br>
many thanks, L<br>
</body>
</html>