Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Mar 2016 19:12:53 +0100
From:      Johan Hendriks <joh.hendriks@gmail.com>
To:        freebsd-stable@freebsd.org
Subject:   output to file different than console. (ssh and zfs )
Message-ID:  <56E1B925.5060105@gmail.com>

next in thread | raw e-mail | index | archive | help
Hello all.

I use a script to get a list of snapshots from a remote machine.

If I run it on the console it gives me the following.

root@storage1:/ # ssh root@storage2.server.mydomain.com /sbin/zfs list
-H -o name -t snapshot | grep 15min_ | sort
storage/home/datadir1@15min_2016-03-09_22.20.00--1h
storage/home/datadir2@15min_2016-03-09_22.20.00--1h
storage/home/datadir3@15min_2016-03-09_22.20.00--1h
storage/home/datadir4@15min_2016-03-09_22.20.00--1h
root@storage1:/ #

As you see the output shows the zfs snapshots of the remote server. I
need this to to into a file so I can grep, sed and do other things with it.
If I put the output to a file than the name of the remote machine is in
that file. ( I see this on my 10.2 machines, not on my 9.x machines.)

root@storage1:/ # ssh root@storage2.server.mydomain.com /sbin/zfs list
-H -o name -t snapshot | grep 15min_ | sort > /tmp/zfs-remote-snapshot
root@storage1:/ # vi /tmp/zfs-remote-snapshot

^[]0;storage2.server.mydomain.com^Gstorage/home/datadir1@15min_2016-03-09_22.20.00--1h
storage/home/datadir2@15min_2016-03-09_22.20.00--1h
storage/home/datadir3@15min_2016-03-09_22.20.00--1h
storage/home/datadir4@15min_2016-03-09_22.20.00--1h

I have no idea why the hostname is in the file.
Is there an option I should give to ssh or something. Like I said, on
FreeBSD 9.x I do not see this.

Thanks for your time.
regards
Johan





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56E1B925.5060105>