Re: OpenBSD 7.0--cron will not run a certain script

2021-11-12 Thread Jeff Ross

On 11/11/21 4:09 PM, Łukasz Moskała wrote:

W dniu 11.11.2021 o 23:55, Jeff Ross pisze:



Hi,

/bin/sh -x /home/jross/sync_to_odroidn2.sh

cat ./sync_to_ordoidn2.sh

Looks like you have typo in file name to me :) odroid in first, ordoid 
in second.



Egads.  Thank you!  That was indeed the problem :-)

Jeff



Re: OpenBSD 7.0--cron will not run a certain script

2021-11-11 Thread Łukasz Moskała

W dniu 11.11.2021 o 23:55, Jeff Ross pisze:

Hi all,

This is on a Raspberry Pi 3B+ (dmesg to follow).

Here's my crontab:

jross@pi:/home/jross $ crontab -l
SHELL=/bin/sh
MAILTO=""

#
#minute hour    mday    month   wday    command
*/2 *   *   *   *   /bin/sh 
/home/jross/upload_latest.sh 2>&1

*   *   *   *   *   python3 4Kwebcam_loop_no_scp.py
38     *   *   *   *   /bin/sh -x 
/home/jross/sync_to_odroidn2.sh 2>&1


The first 2 scripts work fine.  The last one absolutely will not.

Here's the very simple script:

jross@pi:/home/jross $ cat ./sync_to_ordoidn2.sh
#!/bin/sh
logger "starting sync to odroidn2"
pgrep -x rsync
if [ $? -eq 0 ]; then
     echo "`date` rsync still running...exiting" >> 
/var/log/rsync_to_odroidn2.out

else
     echo "`date` starting rsync..." >> /var/log/rsync_to_odroidn2.out
     /usr/local/bin/rsync -avPz /home/jross/webcam/ 
odroidn2:/samba/starhouse/webcam/ | tee -a /var/log/rsync_to_odroidn2.out

     echo "`date` finished rsync..." >> /var/log/rsync_to_odroidn2.out
fi

Here's where cron says it's firing the script:

2021-11-11 15:38:01.305599500 127.0.0.1: cron.info: Nov 11 15:38:01 
cron[95324]: (jross) CMD (/bin/sh -x /home/jross/sync_to_odroidn2.sh 2>&1)


But, no comment into syslog from the logger line and the script simply 
does not run.


Running the script manually, though, works fine:

2021-11-11 15:47:05.959176500 127.0.0.1: user.notice: Nov 11 15:47:05 
jross: starting sync to odroidn2


sending incremental file list
4Kwebcam_2021/
4Kwebcam_2021/4Kwebcam_1636669302.jpg
   2,113,298 100%    6.85MB/s    0:00:00 (xfr#1, to-chk=75/1323)
4Kwebcam_2021/4Kwebcam_1636669333.jpg
   2,109,678 100%    1.48MB/s    0:00:01 (xfr#2, to-chk=74/1323)
4Kwebcam_2021/4Kwebcam_1636669357.jpg
   2,108,931 100%    1.73MB/s    0:00:01 (xfr#3, to-chk=73/1323)

...and so on

I originally had this script running under cron with */10 in the minute 
column.  As a part of debugging I've adjusted the interval to every 5 
minutes and then to a set minute in the hour.


I'm using full paths everywhere in the script so it can't be that.

I do not know what else to try...

Jeff

dmesg:

jross@pi:/home/jross $ dmesg
OpenBSD 7.0 (GENERIC.MP) #1332: Thu Sep 30 16:53:51 MDT 2021
dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 970907648 (925MB)
avail mem = 908574720 (866MB)
random: good seed from bootblocks
mainbus0 at root: Raspberry Pi 3 Model B Plus Rev 1.3
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
cpu0: CRC32,ASID16
cpu1 at mainbus0 mpidr 1: ARM Cortex-A53 r0p4
cpu1: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu1: 512KB 64b/line 16-way L2 cache
cpu1: CRC32,ASID16
cpu2 at mainbus0 mpidr 2: ARM Cortex-A53 r0p4
cpu2: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu2: 512KB 64b/line 16-way L2 cache
cpu2: CRC32,ASID16
cpu3 at mainbus0 mpidr 3: ARM Cortex-A53 r0p4
cpu3: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu3: 512KB 64b/line 16-way L2 cache
cpu3: CRC32,ASID16
efi0 at mainbus0: UEFI 2.8
efi0: Das U-Boot rev 0x20210700
apm0 at mainbus0
simplefb0 at mainbus0: 656x416, 32bpp
wsdisplay0 at simplefb0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"system" at mainbus0 not configured
"axi" at mainbus0 not configured
simplebus0 at mainbus0: "soc"
bcmclock0 at simplebus0
bcmmbox0 at simplebus0
bcmgpio0 at simplebus0
bcmaux0 at simplebus0
bcmdmac0 at simplebus0: DMA0 DMA2 DMA4 DMA5 DMA8 DMA9 DMA10
bcmintc0 at simplebus0
pluart0 at simplebus0
bcmsdhost0 at simplebus0: 250 MHz base clock
sdmmc0 at bcmsdhost0: 4-bit, sd high-speed, mmc high-speed, dma
dwctwo0 at simplebus0
bcmdog0 at simplebus0
bcmrng0 at simplebus0
bcmtemp0 at simplebus0
"local_intc" at simplebus0 not configured
sdhc0 at simplebus0
sdhc0: SDHC 3.0, 200 MHz base clock
sdmmc1 at sdhc0: 4-bit, sd high-speed, mmc high-speed
"firmware" at simplebus0 not configured
"power" at simplebus0 not configured
"mailbox" at simplebus0 not configured
"gpiomem" at simplebus0 not configured
"fb" at simplebus0 not configured
"vcsm" at simplebus0 not configured
"clocks" at mainbus0 not configured
"phy" at mainbus0 not configured
"arm-pmu" at mainbus0 not configured
agtimer0 at mainbus0: 19200 kHz
"leds" at mainbus0 not configured
"fixedregulator_3v3" at mainbus0 not configured
"fixedregulator_5v0" at mainbus0 not configured
"bootloader" at mainbus0 not configured
dt: 445 probes
usb0 at dwctwo0: USB revision 2.0
scsibus0 at sdmmc0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0:  removable
sd0: 121942MB, 512 bytes/sector, 249737216 sectors
uhub0 at usb0 configuration 1 interface 0 "Broadcom DWC2 root hub" rev 
2.00/1.00 addr 1
uhub1 at uhub0 port 1 configuration 1 interface 0 "Standard Microsystems