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,
Backup Script
Re: Backup Script
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.
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.