Sample Header Ad - 728x90

how can I detect if my infinite cp command has failed using bash

0 votes
1 answer
210 views
I have a little data collector, a Raspberry Pi Zero W, which, on boot, mounts a remote folder on mnt using sshfs. The data transfer is effected using a cp command, e.g., cp device file & where device is local and file is in the remote folder. This is intended to be an infinite loop. If power to the Pi fails the process restarts when power returns. But what if the server goes down during the copying? I'd like to then loop into a reboot until copying resumes. But how can I tell, from the pi, when the server is out?
Asked by Dave Stevens (11 rep)
Jul 19, 2022, 02:35 AM
Last activity: Jul 19, 2022, 04:31 AM