BackupPC-users

Re: [BackupPC-users] Restore only file attributes

2013-01-24 15:41:50
Subject: Re: [BackupPC-users] Restore only file attributes
From: John Rouillard <rouilj-backuppc AT renesys DOT com>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Thu, 24 Jan 2013 20:40:06 +0000
On Thu, Jan 24, 2013 at 12:23:41PM +0100, Olivier Le Monnier wrote:
>   Using backuppc for years with no problems but lots of joy, we suddenly
> need (the guy who typed 'chmod 777 -R /bla *' is gonna be fired) to
> restore only the attributes of all filesharing space.
> 
>   Knowing these attributes are stored and saved in attrib files, I was
> wondering if there's a simple way to restore only these attributes
> without touching the contents.

What I would do is create a tarball of the files from backuppc
(BackupPC_tarCreate). Then pipe that into tar -tvf - it should list
every file, perms and owner/group.

  drwxr-xr-x rouilj/staff      0 2006-11-02 16:30 etc/logwatch/
  -rw-r--r-- rouilj/staff   1663 2009-07-06 14:36 etc/bashrc/bashrc

then pipe that into your favorite programming language (perl, awk,
sed) to transform it into a chmod compatible mode and file/directory
spec and apply it using chmod.

Note that this will only handle files in the backup, if there are
files with the wrong perms that are not in the backup (files newer
than the last backup or one of the ignored types of files such as
sockets) you will have to find/fix those manually.

-- 
                                -- rouilj

John Rouillard       System Administrator
Renesys Corporation  603-244-9084 (cell)  603-643-9300 x 111

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/

<Prev in Thread] Current Thread [Next in Thread>