From owner-freebsd-questions@freebsd.org Fri Aug 18 20:20:24 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94243DD44B3 for ; Fri, 18 Aug 2017 20:20:24 +0000 (UTC) (envelope-from prvs=1396f6b5a6=vogelke@pobox.com) Received: from WPAFB-MAIL6.AFNOC.Af.MIL (wpafb-mail6.afnoc.af.mil [131.27.1.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "WPAFB-MAIL6.AFNOC.Af.MIL", Issuer "WPAFB-MAIL6.AFNOC.Af.MIL" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 25C9673A7B for ; Fri, 18 Aug 2017 20:20:23 +0000 (UTC) (envelope-from prvs=1396f6b5a6=vogelke@pobox.com) Received: from us.af.mil (unknown [131.9.254.134]) by WPAFB-MAIL6.AFNOC.Af.MIL with smtp (TLS: TLSv1/SSLv3,256bits,DHE-RSA-AES256-SHA) id 1be9_0749_8c81d179_6690_40e3_a8d0_8b062c1d6179; Fri, 18 Aug 2017 20:20:11 +0000 Received: from ([131.9.40.227]) by 52vejx-mr-003.us.af.mil with SMTP id 40Z0FN1.307461889; Fri, 18 Aug 2017 15:20:08 -0500 Received: (qmail 24511 invoked by uid 100); 18 Aug 2017 20:20:07 -0000 From: "Karl Vogel" Date: Fri, 18 Aug 2017 16:20:07 -0400 To: freebsd-questions@freebsd.org Subject: Re: Anything specific to keep in mind restoring from rsync? Message-ID: <20170818202007.GA23449@bsd118.wpafb.af.mil> Reply-To: vogelke@pobox.com References: <20170818221842.I98697@sola.nimnet.asn.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170818221842.I98697@sola.nimnet.asn.au> User-Agent: Mutt/1.6.0 (2016-04-01) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2017 20:20:24 -0000 On Fri, Aug 18, 2017 at 10:59:33PM +1000, Ian Smith wrote: > rsync is great for 'user data', but I'm not sure whether it handles hard > links properly, which you'll want for system directories at least. Use the "-H" option to handle hard links. This might burn you if you're providing a list of files to rsync instead of letting it roam over an entire tree; if all the linked files aren't included in your list, rsync has no way of knowing about them. > Do you have some reason not to use the canonical dump(8) and restore(8)? I avoid those because I copy between different systems (Linux, Solaris, BSD) much more often than between identical ones. > If you're going with rsync, I strongly suggest not using /tmp; all sorts > of things may use that for, well, temporary files during the operation. Good advice -- you want a real filesystem for your target. The only other thing I can think of is watch the trailing slashes in rsync arguments; it makes a big difference in where your files end up. I use the script below to sync Maildirs under date-based directories between two systems. -- Karl Vogel I don't speak for the USAF or my company Mangled song lyric: Baking carrot biscuits. Actual lyric: Taking care of business. ("Takin' Care Of Business") -------------------------------------------------------------------------- #!/bin/ksh # /dev/null) case "$?" in 0) ;; *) echo "$when: bad date" >&2 ; exit 1 ;; esac # Do the copy, and delete extraneous destination files. rsync -raxu --delete -e \ "ssh -c chacha20-poly1305@openssh.com -i $HOME/.ssh/bkup_ed25519" \ $HOME/notebook/$ymd/Maildir/ \ backup.example.com:$HOME/notebook/$ymd/Maildir exit 0