1

Script on sending end is as follows:

#!/bin/sh

#Variables

bigdata=vid-zfs-live/bigdata

today=`gdate +%m-%d-%y`

yesterday=`gdate -d'yesterday' +%m-%d-%y`


#Actions

zfs snapshot -r "$bigdata"@"$today"

zfs send -i "$bigdata"@"$yesterday" "$bigdata"@"$today" | nc -w 700 192.168.10.11 8024

Cron entry on sending end is as follows:

30 0 * * * /scripts/zfssendBigData.sh > /tmp/cron1.log

Script on receiving end is as follows:

#!/bin/sh

/usr/bin/nc -l -p 8024 | zfs receive -F vid-zfs-bak/bigdata

Cron entry on receiving end is as follows:

 29 0 * * * /scripts/zfsreceiveBigData.sh > /tmp/cron2.log

cron1.log and cron2.log are both empty.

mailx on the receiving end shows:

Your "cron" job on atm-frontend-02
/scripts/zfsreceiveBigData.sh

produced the following output:

nc: -w has no effect with -l
cannot receive: failed to read from stream

Things Worth Noting:

The snapshot portion works fine, the snapshots are created. So I know the script is running. It's specifically the send/receive that isn't working.

I tried using absolute paths to all the programs like /usr/bin/nc, /usr/sbin/zfs, etc.

I verified the clocks on both systems are within 10 seconds of each other.

Both systems Solaris 11.3

1
  • Dumb question first: Where is nc: -w has no effect with -l coming from? Are you certain your receiving script is as shown? Or possibly you have an alias for nc somewhere? Equally dumb question: Are you sure you're not using port 8024 for anything else? (It's possible with Solaris nc to listen on both 0.0.0.0:8024 and a specific IP such as 192.168.10.11:8024) – Brandon Xavier Apr 30 '16 at 4:04
1

I would suggest executing the script from the sending side and using that to trigger the receive portion. There's no sense in starting a cron job on both ends...

You can issue commands on your remote server from the local server using ssh.

1
  • I thought about that but the SSH overhead slows it down. I've tried mbuffer to no avail. The two machines are directly connected by ethernet so I don't see netcat as security risk. – Copy Run Start Apr 30 '16 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.