Backup Script

General support questions
Post Reply
nmrdukeman
Posts: 36
Joined: 2016/02/24 19:11:41

Backup Script

Post by nmrdukeman » 2019/08/22 16:56:32

Hi,
I have a question about a BASH backup script. I have "many" /home/user accounts, and need to backup their subdirectories in each /home/user/data.
I know how to do that with cron for each user. However, there must be a way that a single script can automatically backup each each account's data as a root.

Does anyone have such script or know where I can get that information?

Thanks for your help in advance.

Best,
;)

Thraex
Posts: 23
Joined: 2019/05/14 19:50:28

Re: Backup Script

Post by Thraex » 2019/08/22 18:16:03

The Linux Shell Scripting Bible by Blum and Bresnahan has a script that's pretty similar to what you're looking for. I think they had a user list in a file and then did a for loop so:
for $user in /file; do `backup command` /home/$user/data/dirname /home/$user/backup.tgz; fi

That's a really rough outline but should get you going.

nmrdukeman
Posts: 36
Joined: 2016/02/24 19:11:41

Re: Backup Script

Post by nmrdukeman » 2019/08/22 20:51:42

Thanks for the info.!

Post Reply

Return to “CentOS 7 - General Support”