Monday 19 December 2011

Copying files from root directory to www

Copying files from root directory to www

Hello,

I have been trying to copy files inside my folder /root/ to the /var/www folder and have used the following to copy them:
Code:

#! /bin/sh

for i in `ls votes.log`
do
mv $i /var/www/$i$.log
done

I have got this script and seems to work locally in the folder, it works if I use /root/ as path but I cannot get it to the /var/www path because it will return:
Code:

mv: cannot move `votes.log' to `var/www/vote/votes.log': No such file or directory
How am I able to solve this? (Just a quick note: I am a total beginner to Linux so I will not be able to do most things myself)

I hope somebody can help me with this,
Aron

No comments:

Post a Comment