LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-20-2023, 12:22 PM   #1
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Rep: Reputation: 73
Couldn't delete messages on server. Why not?


I have a little Ubuntu 22.04 cloud server.

I couldn't get it to send email, so I just save messages from the contact webpage to the server using php and download them with a bash script. I only get a few messages, it's not very active.

I usually upload or delete files using Filezilla.

In the folder

Quote:
/var/www/mywebpage.com/public_html/contact/messages
I had 3 messages from people who wanted to improve my webpage for me. I could not delete them.

Below is from Filezilla:

Quote:
Command: rm "/var/www/mywebpage.com/public_html/contact/messages/Mike Adamson mikeDupdooks@gmail.com05 Dec 2023 08:39:17.txt"
Error: rm /var/www/mywebpage.com/public_html/contact/messages/Mike Adamson mikeDupdooks@gmail.com05 Dec 2023 08:39:17.txt: no such file or directory
Command: rm "/var/www/mywebpage.com/public_html/contact/messages/Mike Cramer petercoopsypose@gmail.com13 Dec 2023 08:34:01.txt"
Error: rm /var/www/mywebpage.com/public_html/contact/messages/Mike Cramer petercoopsypose@gmail.com13 Dec 2023 08:34:01.txt: no such file or directory
Command: rm "/var/www/mywebpage.com/public_html/contact/messages/Mike Edwards mikeDupdooks@gmail.com09 Dec 2023 01:12:43.txt"
Error: rm /var/www/mywebpage.com/public_html/contact/messages/Mike Edwards mikeDupdooks@gmail.com09 Dec 2023 01:12:43.txt: no such file or directory
Status: Deleting "/var/www/mywebpage.com/public_html/contact/messages/Mike Edwards mikeDupdooks@gmail.com09 Dec 2023 01:12:43.txt"
Why couldn't I delete them?

Trial messages from myself or friends didn't have this problem, I can delete them in Filezilla, no problem.

Was it the spaces in the file names?

I connected to my cloud server using ssh, went to the directory with the messages and used rm:
Code:
rm -v *
I got this message each time:

Quote:
rm: remove write-protected regular file 'Mike Adamson'$'\r\n''mikeDupdooks@gmail.com05 Dec 2023 08:39:17.txt'?
When I entered y, the file was deleted! As far as I could see, these messages had exactly the same permissions as the files I could delete.

How to do this in a better way?

Last edited by Pedroski; 12-20-2023 at 12:23 PM.
 
Old 12-21-2023, 03:53 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,484

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by Pedroski View Post
Was it the spaces in the file names?
First of all it looks like Filezilla not detecting that there's a CR/LF pair between the name and e-mail address.

Second, regarding permissions, it's impossible to really tell as you don't include any details of what the permissions and output from chattr for the files.
 
Old 12-21-2023, 04:17 AM   #3
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Sorry, the permissions were rw r r
 
Old 12-21-2023, 04:24 AM   #4
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,819

Rep: Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211Reputation: 1211
I think the write bit is missing.
Try
Code:
rm -fv *
Or set all the write bits with
Code:
chmod +w *
Apparently there is a bug in Filezilla concerning the special characters in the file names.
 
Old 12-21-2023, 08:33 AM   #5
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Original Poster
Rep: Reputation: 73
Thanks, I will try that next time I have messages from those who would improve my webpage!

When I log in through ssh, I am the admin with sudo powers, so I thought I could delete anything in the webpage part of the cloud at least!

I put

--remove-source-files

in my bash script rsync command.

Maybe that will do the job!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Why does the 'edit' button offer 'edit/delete' if it can't delete? RandomTroll LQ Suggestions & Feedback 10 10-23-2018 03:25 AM
FTP server hanging at PASS, couldn't tell why anon091 Linux - Server 6 04-09-2013 08:56 AM
ut2003--- couldn't set video mode:couldn't find matching GLX visual <h1>tux</h1> Linux - Newbie 1 08-22-2003 07:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration