LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 08-28-2009, 02:00 PM   #1
thepalsrus
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Rep: Reputation: 0
Backup only user created data


I am trying to figure out a way to backup any changes made by the user on a Ubuntu system.
I want to isolate the installed packages from the user data and backup only the user data.
The user may not have kept the files exclusively in the home directory and so I need to be able to find the changes and create a backup of just user created files.
I do not have a backup of the initial system installation and do not want to backup packages files.
The user is a python programmer and stores files in various locations outside the home directory.

I was thinking of trying to pull a list of all installed package files into a text file and excluding them during a backup. Is there an easier way to do this? Can I pull the list into the command without having to dump it to a file first?

Thanks
 
Old 08-28-2009, 02:07 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Hi, welcome to LQ!

If the user creates the files as himself (not using sudo/su
to get them everywhere) you should be able to just locate
them using his UID or name.

man find
/uid


Cheers,
Tink
 
Old 08-28-2009, 02:28 PM   #3
thepalsrus
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Wouldn't that give me all the files of the packages installed by that user as well? Is there anyway to find the ones he created even if he used sudo?
 
Old 08-28-2009, 02:33 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Wouldn't that give me all the files of the packages installed by that user as well?
The "normal" way of package installations is via su/sudo mechanisms.
In either case the owner will be either root, or some system user (e.g.
apache or httpd).

Quote:
Is there anyway to find the ones he created even if he used sudo?
Short of the diff you already suggested: no.
You could go by time-stamps, but that's only valid for non-volatile
things (e.g., it wouldn't make sense for most files under /var).


Cheers,
Tink
 
Old 08-28-2009, 02:54 PM   #5
thepalsrus
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Original Poster
Rep: Reputation: 0
I am looking for a multi-platform solution. I was thinking about using the find command to find all the files used by that user, but it would not work since the user can use sudo to create files or install apps. I thought I could use:

for ENT in $(rpm -qa --filesbypkg | tr -s '[:blank:]' ' ' | sed 's:^[^ ]* ::' | sort -u); do if [ ! -d "${ENT}" ]; then echo "${ENT}" >> /tmp/rsync.exclude; fi; done

and them just exclude the files listed in the rsync.exclude file during backup. Is there an easier way to do this?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Created user in Webmin - how to lock that user in specified directory? guest Linux - Security 1 04-18-2009 08:21 PM
Backing up ~75GB of data on Redhat rel 4 srvr using backup exec shows ~1.3TB of data? unicorntoo Linux - Software 1 05-01-2008 09:32 AM
Using rsync to backup data. Best way to backup folders? Micro420 Linux - General 2 11-23-2006 02:13 AM
dont want backup files to be created in mandrake 10.0 ranger225 Linux - Newbie 5 09-23-2004 05:36 PM
user information and data backup wenberg Linux - General 1 01-26-2004 04:21 AM


All times are GMT -5. The time now is 01:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration