LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-10-2009, 03:30 AM   #1
prudens
Member
 
Registered: Jul 2009
Posts: 52

Rep: Reputation: 15
File keeps returning to previous


Hi,

This is a really really weird occurence... I can upload the file, but after I upload it the file on the server is still the previous version... Nothing changed

Say I have this content in my old file:

line 1
line 2

and i have this content in my new file:

line 1
line 2
line 3

after I upload it, I open the file it still says:

line 1
line 2


What's going on? I have chown -r, and owns the directory. No permission problems.
 
Old 08-10-2009, 03:40 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Can you tell us a bit more?

- How are you uploading (scp/ftp/other)?
- Are there any (error) messages when uploading?
 
Old 08-10-2009, 03:43 AM   #3
prudens
Member
 
Registered: Jul 2009
Posts: 52

Original Poster
Rep: Reputation: 15
i use sftp. there's no error... just says STOR blahblah.txt complete. But it's as if nothing happened, the new file doesn't change.
 
Old 08-10-2009, 03:49 AM   #4
prudens
Member
 
Registered: Jul 2009
Posts: 52

Original Poster
Rep: Reputation: 15
But if I delete the file first on the server, then upload it, it will work, but overwrites just doesn't work... it says STOR complete, but not true.
 
Old 08-10-2009, 03:49 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
This is an FTP server?

Are you certain you are putting/uploading the file to the directory you thing you are putting/uploading it to?

There are FTP client commands to list which directory you are in and to list the files in your current directory. They might help, including displaying the last modification time on the file you think you have overwritten after upload.
 
Old 08-10-2009, 03:49 AM   #6
prudens
Member
 
Registered: Jul 2009
Posts: 52

Original Poster
Rep: Reputation: 15
But If I just delete the file then reupload, it works. Overwrites doesn't work. It says STOR complete, but doesn't change anything.
 
Old 08-10-2009, 03:50 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi again,

- Are you sure you are ftp-ing to the correct directory?
- If you remove the file (server side) and try, does that work (is the new file created and correct)?
- You could try running ftp with the -v option and see if there are additional messages.
- Any messages in the ftp logs?
 
Old 08-10-2009, 03:53 AM   #8
prudens
Member
 
Registered: Jul 2009
Posts: 52

Original Poster
Rep: Reputation: 15
the thing about this is that these directories are results of tar -xvf... do I have to reset my permissions?

FTP doesn't say any permission problems when i upload... the only problem is when I try to overwrite existing files... it simply doesn't update it.
 
Old 08-10-2009, 03:57 AM   #9
prudens
Member
 
Registered: Jul 2009
Posts: 52

Original Poster
Rep: Reputation: 15
And also, random files are getting corrupted... what's going on?
 
Old 08-10-2009, 04:10 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Ok this is getting unclear,

- What did you actually do? How does tar fit into that?
- Which random files get corrupted (and is that ftp related)?

One other thing: Which ftp server do you have running and does the config have a "do not replace existing file(s)" option?
 
Old 08-10-2009, 04:11 AM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by prudens View Post
And also, random files are getting corrupted... what's going on?
Scary! When I wrote I had only seen your first message; from your further messages I understand that you are in the right directory and the FTP server reports that it has successfully stored a file when it hasn't but it works if you delete the existing file of the same name first. That's not nice!

You could work around this problem by ensuring each new tar archive has a different name or by deleting the existing file first but the corruption is scary. What symptoms do you find that makes you conclude the files are being randomly corrupted? It would be prudent (ha!) to keep a checksum of each file to check integrity, or use par2 if you want to be able to both check for corruption and repair.

If you are transferring in binary mode and seeing corruption then you could try a different FTP server to see if the problem is associated with the server or your end.
 
Old 08-10-2009, 04:12 AM   #12
prudens
Member
 
Registered: Jul 2009
Posts: 52

Original Poster
Rep: Reputation: 15
Alright sorry about unclear, it's 4AM and I'm quite pissed

I recently moved from another server, so I packaged my directory in tar, then I used tar -xvf to extract it

I used chown -R root /directory/

so now I tried to upload, it doesn't work. It doesn't say permission denied either... Just the newer file doesn't get updated.

Also, I noticed some extracted files are corrupted...
 
Old 08-10-2009, 04:18 AM   #13
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by prudens View Post
the thing about this is that these directories are results of tar -xvf... do I have to reset my permissions?
You mean files, not directories? Assuming you mean that the files you are uploading to the FTP server are tar archives then it doesn't matter that they are tar archives; to the FTP server they are just files (but they could contain non-ASCII data so should be transferred in binary mode).

I'm fairly confident that file ownerships and permissions on the FTP client are not transferred to the FTP server in which case they are irrelevant.
 
Old 08-10-2009, 04:25 AM   #14
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by prudens View Post
Alright sorry about unclear, it's 4AM and I'm quite pissed

I recently moved from another server, so I packaged my directory in tar, then I used tar -xvf to extract it

I used chown -R root /directory/

so now I tried to upload, it doesn't work. It doesn't say permission denied either... Just the newer file doesn't get updated.

Also, I noticed some extracted files are corrupted...
Made me chuckle! Here it's 3 PM in the afternoon and I'm soberer than some judges but now I'm less clear, not more

You're moving data from one computer to another and tarred it up and uploaded it to an FTP server and now you're downloading and restoring it? But then the uploading would be done so why are you having an upload problem?
 
  


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
ftp not returning from STOR <file> keefobeefo Linux - Networking 2 06-04-2009 02:36 AM
apache mod_fastcgi: .fcgi file returning as text. Llanilek Linux - Software 0 10-25-2008 10:05 AM
getting a previous file zakir_123 Linux - Newbie 4 06-02-2008 02:59 AM
File searching programs not returning expected results Shadow ZERO Linux - Software 3 07-26-2007 02:35 PM
In a terminal window, How do you 'backup" to a previous file? sleekmason Linux - Software 4 05-06-2006 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:56 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