Forum Moderators: bakedjake

Message Too Old, No Replies

Undeletable folder in Linux

         

haryanto

11:27 pm on May 4, 2004 (gmt 0)

10+ Year Member



Hi guys.

There is a very weird folder on my server.
The name is somefolder\r
Does the \r at the end mean something?

when I try to rm -Rf somefolder\r
it deson't remove the folder!

I tried using WS_FTP to delete but no use.

Please help!

encyclo

11:39 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"\r" is usually a carriage return. Have you tried:

rm -rf somefolder*

That might work!

haryanto

11:59 pm on May 4, 2004 (gmt 0)

10+ Year Member



it works!

Youre da man!

haryanto

12:03 am on May 5, 2004 (gmt 0)

10+ Year Member



Weird thing is I created the folder using a schell script. Maybe the text editor I used added some extra characters.

On other occasions the character %0D is added t my script. I don't see that when I wrote the shell script.

What is the best utility to create a shell script?

quebrada

12:58 am on May 5, 2004 (gmt 0)

10+ Year Member



Everyone has a favorite.

I grew up on vi so that is always my first choice for small programs. Not everyone shares my enchantment, but it works for me.

Q

bakedjake

5:22 pm on May 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Did you create the script on a Windows box then upload it via FTP? Or was it created on the local machine?

As far as creating shell scripts, any of the normal text editors will do.

haryanto

6:17 pm on May 5, 2004 (gmt 0)

10+ Year Member



Blaked jake yes I created it on Windows using Metapad.
[liquidninja.com...]
Then uploaded it using WS_FTP

Do you see any way things can go wrong?

bakedjake

7:09 pm on May 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Make sure when you upload the file, you upload it in TEXT mode and not binary mode.

Binary mode will bork your text files.

haryanto

8:43 pm on May 5, 2004 (gmt 0)

10+ Year Member



Yeah I am using WSFTP.
The default for .sh file is ascii mode.
So that wasn't the problem....
Wonder why Im always getting %0D added at the end of my shell script.

When I wrote the script using PICO right on the server itself there was no problem but when I uploaded it everything screws up!

;-(

seanpecor

12:58 pm on May 6, 2004 (gmt 0)

10+ Year Member



I use rsync to publish changes from my staging server (in the home office) to the production server. I switched from ftp to rsync about six months ago, and it's a tremendous time saver.

The beauty of rsync is that it will only publish changes made to files on the staging server. For example, instead of uploading 910 files, it uploads only the 3 that changed. The scan for file changes across the entire directory tree takes less than a second, and then it streams the changes. Nice!

To get this done you need an rsync server running on your desktop, and the rsync client on your production server. I imagine there must be an rsync server you can run on XP and OS X? I run Linux/KDE on my main workstation so it is more straightforward for me.

Sean.

haryanto

7:08 pm on May 6, 2004 (gmt 0)

10+ Year Member



Sounds good. can we program rsync to exclude files during the process?

There are some files that I would not want to get published online.

seanpecor

11:08 pm on May 7, 2004 (gmt 0)

10+ Year Member



haryanto, sorry I didn't get back sooner. Yes, you can configure rsyncd not to include particular files or folders.

Here is an example /etc/rsyncd/rscynd.conf file:

##begin
[mysite]
path = /site/abc.com/html
exclude = secret/* dynamic/*
uid = 501
gid = 501
##end

Then, on the production server, you'd run:

cd /sites/abc.com/html
rsync -rv rsync://dev.abc.com/mysite

And it would connect to your rsyncd server on your dev.abc.com machine, and run an update using the "mysite" configuration directives. In this example it would run as a specific user:group (501:501), and ignore files in /sites/abc.com/html/secret/* and /sites/abc.com/html/dynamic/*.

For more info you might google "rsyncd" and read some advanced instructions; I only consider myself an intermediate user at this point and I'm certain there are power tricks that I haven't stumbled over yet ;)

Sean.