Results 1 to 10 of 11
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 ...
- 12-19-2011 #1Just Joined!
- Join Date
- Dec 2011
- Posts
- 5
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:
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:#! /bin/sh for i in `ls votes.log` do mv $i /var/www/$i$.log done
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)Code:mv: cannot move `votes.log' to `var/www/vote/votes.log': No such file or directory
I hope somebody can help me with this,
Aron
- 12-19-2011 #2
Check your script, your variables are wrong:
use
but i don't know how exactly you are wanting your structure to lookCode:for i in `ls votes.log` do mv $i /var/www/ done
linux user # 503963
- 12-20-2011 #3Just Joined!
- Join Date
- Dec 2011
- Posts
- 5
Thank you for your reaction.
I think I have found out what the problem was but currently have made a much bigger mistake. I have found out that my "root" user was assigned to the /root/ folder and not the / folder, so it could not open the /var/www/ folder. So I have attempted creating a new account and then assign it to the / folder. I did the following thing:
I found this on the ubuntu help site.Code:adduser server sudo chown -R server:server /
But now after I disconnected and attempt to connect through putty, it returns: "Server Unexpectedly closed network connection."
How will I be able to fix this and the other problem with the folders?
I hope somebody can help me further,
Aron
- 12-20-2011 #4
I could be wrong, but I think that's very bad. Is this a server you have direct access to? Also could you post the URL where you found this please? (You may need to put a couple of spaces in there to get it past the spam filter)
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 12-20-2011 #5Just Joined!
- Join Date
- Dec 2011
- Posts
- 5
I just found out my FTP is not working either, and yes, it is a server hosted at Kimsufi which I have direct access to.
The bad thing is that I currently have an active server running which I can not backup since I cannot connect through SSH or FTP, and rebooting will shut it down.
The link is: help. ubuntu.com /11.04/serverguide/C/user-management .html
- 12-20-2011 #6
It looks like you have created a new user called server and then changed ALL files to be owned by that user. The only way I know how to fix this kind of situation is to boot the server from a CD and while in front of the machine use a chrooted environment to sort out the permissions.
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 12-20-2011 #7Just Joined!
- Join Date
- Dec 2011
- Posts
- 5
What do you think the best solution is since it is impossible for me to go to the datacenter it is located in, although I can reinstall it through the website. But I cannot have all the files stored on the server going to wash away.
- 12-20-2011 #8If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 12-20-2011 #9Just Joined!
- Join Date
- Dec 2011
- Posts
- 5
But do you think the host will be able to fix the permissions without having to reinstall it? If so, I will hope they can help me with this and will figure it out.
- 12-20-2011 #10
I would assume so, but they would have to confirm that
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.


Reply With Quote
