LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-05-2006, 03:26 AM   #1
ginda
Member
 
Registered: Mar 2004
Distribution: SUSE8.2, 9.2, Knoppix
Posts: 323

Rep: Reputation: 31
Writing a script to backup up /home/username


I need to write a scritp that can list all users dir and backup them up individually as .tar

Can some one please help
 
Old 01-05-2006, 04:55 AM   #2
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Automating backups with Tar
As for getting a list of all usernames, you're best bet is probably going to be to 'cat' /etc/passwd and pipe it to 'cut -d : -f1' inside a loop.

Last edited by scuzzman; 01-05-2006 at 04:59 AM.
 
Old 01-05-2006, 05:26 AM   #3
kshkid
Member
 
Registered: Dec 2005
Distribution: RHEL3, FC3
Posts: 383

Rep: Reputation: 30
for retrieving user names

just awk would do

Code:
awk -F":" '{print $1}' /etc/passwd
 
Old 01-05-2006, 06:47 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
tar cvf home.tar /home
 
  


Reply



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
why email INBOX directory is in /var/spool/mail instead of /home/username csjonathan Linux - General 4 11-06-2008 01:14 PM
writing backup script b123coder Programming 1 12-09-2004 03:03 AM
Xauth will not unlock a file at /home/username javpra Linux - Newbie 3 09-08-2004 07:36 PM
Using su <username> in Script lapthorn Programming 2 02-24-2004 09:43 AM
Squirrelmail not reading /home/username/Mail/Inbox di11rod Linux - Software 2 01-22-2004 06:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:29 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
Open Source Consulting | Domain Registration