[OpenIndiana-discuss] zfs snapshot script

Kees Nuyt k.nuyt at zonnet.nl
Sun May 1 14:59:53 UTC 2011


On Sun, 1 May 2011 09:48:22 -0400, you wrote:

>Hmmm, well, what I've seen a couple of places (and have been using myself)
>is rsyncd.conf on the OS box having a post-exec cmd that takes the
>snapshot...
>
>-----Original Message-----
>From: Matt Connolly [mailto:matt.connolly.au at gmail.com] 
>Sent: Sunday, May 01, 2011 9:46 AM
>To: Discussion list for OpenIndiana
>Subject: [OpenIndiana-discuss] zfs snapshot script
>
>Hi all,
>
>I'm putting together a script to create zfs snapshots after a backup has
>been completed (via Apple TimeMachine or rsync for example). When I'm logged
>into the machine, I can only access the "zfs snapshot" command as root via
>"sudo" or "pfexec". Neither of these are available directly from a ssh
>command. For example:
>
>client$ ssh user at server
>server$ sudo zfs snapshot blah at blah -> works
>..or..
>server$ pfexec zfs snapshot blah at blah -> works
>
>..but..
>
>client$ ssh user at host zfs snapshot blah -> fails = permission denied
>client$ ssh user at host pfexec zfs snapshot blah -> fails = permission denied
>client$ ssh user at host sudo zfs snapshot blah -> fails = sudo: no tty present
>and no askpass program specified

The program on the server side expects a pseudo terminal but
doesn't get one. Play with the -f -n -t options of ssh (don't know
which one from the top of my head).

It may not be a problem here but it is good practice to quote the
command line, as in: 

client$ ssh user at host "sudo zfs snapshot blah"
-- 
  (  Kees Nuyt
  )
c[_]



More information about the OpenIndiana-discuss mailing list