Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How to copy files from source


to destination

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Another way to do it (assuming you're trying to copy all the files over):

rsync -a /backup/cpbackup/daily/user* /home/

If you want just index.html and nothing else:

rsync -av --include=*/ --include=*public_html/index.html --exclude=* /backup/cpbackup/daily/user* /home/
share|improve this answer
the user not like user 1 and user 2 , it's example , i mention usernames like jogn and smith not all have the same user name folder – iLinux85 Oct 2 '13 at 21:53
Then substitute * for user* rsync -a /backup/cpbackup/daily/* /home/ – yoonix Oct 2 '13 at 21:53

This would be one way to do it:

for user in user1 user2 user3 user4 user5 user6; do
  cp /backup/cpbackup/daily/$user/public_html/index.html /home/$user/public_html/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.