Results 1 to 4 of 4
I created a bash script that will tar all files inside a user's directory after 30 days but it seems not working. All my users has a directory named documents ...
- 11-23-2009 #1Linux Newbie
- Join Date
- Mar 2006
- Posts
- 101
how to apply to all users using bash
I created a bash script that will tar all files inside a user's directory after 30 days but it seems not working. All my users has a directory named documents and inside that was a file. I want to backup all files inside their home directory and named it according to their usernam. If there is a user foo, the tar file should be foo.tar.gz
#!/bin/bash
USERS=`cat /etc/passwd | awk '{print $1}' | awk -F: '{print $1}'`
for users in $USERS;do
find /home/$USERS/back_up/new -type f -mtime +30 | xargs tar rvf /backup/emails/$USERS.tar
done
I encountered this error
Any advise?find: foo: No such file or directory
- 11-23-2009 #2
- 11-23-2009 #3Just Joined!
- Join Date
- Aug 2005
- Posts
- 65
should we consider that linuxquestion is faster in replaying or what do u think packets ?
- 11-24-2009 #4Linux Newbie
- Join Date
- Mar 2006
- Posts
- 101


Reply With Quote
