1

This is the command I'm running:

parallel -u ::: 'watch -n 0.1 /home/cringeposter/zfs-mount.sh' 'watch -n 0.1 drill graph.microsoft.com' 'rclone bisync onedrive: /home/cringeposter/zfs/onedrive --verbose --check-access --ignore-checksum' 'rclone bisync onedrive-uni: /home/cringeposter/zfs/onedrive-uni --verbose --check-access --ignore-checksum'

The two rclone commands are doing bidirectional syncs on two directories. The zfs-mount.sh script is needed because of an issue with ZFS on Linux where encrypted datasets get randomly unmounted, while the drill call is needed to avoid rclone stopping because it's not able to resolve a domain (this way the IP address is cached by dnsmasq).

Right now I have to manually stop GNU parallel after the bisync completes successfully by pressing CTRL+C in the terminal emulator, but it would be nice if it was done automatically.
The two watch processes keep running after the two rclone processes exit, is there any way to automatically send them a SIGINT after both rclone processes have exited?

1 Answers1

0

How about something like (tested):

parallel -j0 --halt now,done=2 --lb \
  ::: "ping pi.dk" "ping tange.dk" \
      "traceroute pi.dk" "traceroute tange.dk"

(untested):

parallel -j0 --halt now,done=2 --lb \
  ::: 'watch -n 0.1 /home/cringeposter/zfs-mount.sh' \
      'watch -n 0.1 drill graph.microsoft.com' \
      'rclone bisync onedrive: /home/cringeposter/zfs/onedrive --verbose --check-access --ignore-checksum' \
      'rclone bisync onedrive-uni: /home/cringeposter/zfs/onedrive-uni --verbose --check-access --ignore-checksum'
Ole Tange
  • 5,099