LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Writing a script to backup up /home/username (https://www.linuxquestions.org/questions/programming-9/writing-a-script-to-backup-up-home-username-399728/)

ginda 01-05-2006 03:26 AM

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

scuzzman 01-05-2006 04:55 AM

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.

kshkid 01-05-2006 05:26 AM

for retrieving user names

just awk would do

Code:

awk -F":" '{print $1}' /etc/passwd

bigearsbilly 01-05-2006 06:47 AM

tar cvf home.tar /home


All times are GMT -5. The time now is 03:14 PM.