LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 11-27-2003, 10:26 AM   #1
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Rep: Reputation: 15
Help with Samba and date modification


Hi all,

An issue with our samba file server here at work was brought to my attention yesterday. When a file is copied/moved over to the server the date of the file is changed to the current date and time that the file is copied over. It does not seem to matter whether you are replacing a file or not.

What I am trying to get at is this: If I have a file on my workstation that is say 2 days old and I copy/move it over to the server, the date is changed to today. If I do this same action from a Windows machine to a windows machine, the date remains as its original date, 2 days ago.

Is it possible to not have the date modified when a file is copied/moved over to the samba server? This is important as a number of our draftspeople do work locally on thier own machines and then copy/move their files over to the server when they are done.

I have search this and other forums for a solution and found none, although the question has been asked but received no responses. I have read the man pages but found nothing that address this issue. I have also googled this problem to death and found very little.

I know that when you are copying/moving files locally on a linux machine you can use flags to control this and I am hoping there is a setting or parameter I can add to get this same type of functionality.

I thank you for any assistance
mdkelly069.

P.S. if it is not possible to get around this then please let me know. Thanks

Last edited by mdkelly069; 11-27-2003 at 10:27 AM.
 
Old 11-27-2003, 01:00 PM   #2
archangel_617b
Member
 
Registered: Sep 2003
Location: GMT -08:00
Distribution: Ubuntu, RHEL/CentOS, Fedora
Posts: 234

Rep: Reputation: 42
The only thing I could find that might work at all for you is from man smb.conf:
dos filetimes (S)
Under DOS and Windows, if a user can write to a file they can change the timestamp on it. Under POSIX semantics, only the owner of the file or root may change the timestamp. By default, Samba runs with POSIX semantics and refuses to change the timestamp on a file if the user smbd is acting on behalf of is not the file owner. Setting this option to yes allows DOS semantics and smbd will change the file timestamp as DOS requires.

Default: dos filetimes = no

If that doesn't do it, I don't see anything else that will do what you want ...
 
Old 11-27-2003, 03:32 PM   #3
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Original Poster
Rep: Reputation: 15
archangel_617b: Thank you for your reply.

All files and folders on the server are owned by the 'komex' group. The drive it is running off of is formatted FAT32 until the higher ups in the IT department become more comfortable with Linux and all the great things it can do for our office.

I did notice the dos filetimes parameter you mentioned, but I was not sure it would do what I was looking for either. I will try t out tonight.

Could the fact the drive is FAT32 be causing some of the problem?

When is the user smbd acting on the file? Is it when a user other than the owner is working with the file?

Sorry for the extra questions but I am still a bit new to the Samba idea. I understand the basics of the system, but am still working on the nitty gritty.

Thanks again
mdkelly069

edit:

Pardon me: all files are owned by root and are part of the komex group. I am thinking this is not the way that it should be, but I am not sure why it is this way. As I mentioned before the only thing diffeent about this setup is that it is running off of a FAT32 drive that is mounted in fstab at boot time.

Last edited by mdkelly069; 11-27-2003 at 03:51 PM.
 
Old 11-28-2003, 12:00 AM   #4
archangel_617b
Member
 
Registered: Sep 2003
Location: GMT -08:00
Distribution: Ubuntu, RHEL/CentOS, Fedora
Posts: 234

Rep: Reputation: 42
You have linux doing file shares from a FAT32 drive to a windows network? Oh. That's tricky. Samba largely is a mapping from Unix to Windows and back (hence all the map opetions). Mounting a Windows drive in Linux would certainly add a layer of complexity since FAT32 doesn't have file permissions and that's likely the obstacle. If at all possible, you should try to move your Samba shares off the FAT partition.

As for when the samba user acts on the file system, it should be rarely if ever. Unless a valid user is provided, files will be owned by the user and group 'nobody' by default. If file permissions are an issue then you should probably create an approriate user and make use of the 'force user = <user>' option.

I hope things are going well for you. Don't forget to read up on chown and chmod. They're your friends.
 
Old 11-28-2003, 10:50 AM   #5
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Original Poster
Rep: Reputation: 15
archangel_617b: Thank you for the reply and the information.

Linux shares off of a FAT32 drive is not by my choice. We used to run a Win2000 file server but after hiring new employees we ran up against the 10 user connection limit. After a couple of weeks of everyone being not happy I suggested we move to a Linux/Samba based solution. The higher ups agreed, but did not totally trust Linux so they required me to run the shares off a FAT32 drive so it could be swapped back to a windows machine on a moments notice.

I think/hope this will be enough to get them to let me move to a Linux native file system. After all the system has been up and running without a hicup for over a month now and I get nothing but compliments for the work.

I definately need to learn more about chown and chmod. I ran up against them last night while I was trying to set up vsftpd at home and was having to type commands I really did not understand.

Thanks again and I will post a follow up when I have converted the drive over.

Your time is much appreciated
mdkelly069
 
Old 11-28-2003, 01:09 PM   #6
archangel_617b
Member
 
Registered: Sep 2003
Location: GMT -08:00
Distribution: Ubuntu, RHEL/CentOS, Fedora
Posts: 234

Rep: Reputation: 42
Congrats. It sounds like you're doing good with the Linux conversion.

In addition to chown and chmod, at some point you may find the schduling facilities, "cron" and "at", very helpful for maintaining your system. I use cron to apply the appropriate permissions to the shared file systems in case something or someone left a file too restrictive (or too public).
 
Old 11-28-2003, 06:26 PM   #7
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Original Poster
Rep: Reputation: 15
hi again archangel_617b,

You it was a bit of an adventure. I had done a similar setup at home for myself, all Linux native though, but never had experience it in the corporate arena. It has gone well so far.

I am using cron already to perform nightly backups and full backups every 28 days. Works very well and I do not have to thinkn about it.

Never heard of 'at' before, have to look that one up.

Thanks again for your help and suggestions
mdkelly069
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Get file modification date/time in Bash script cmfarley19 Programming 12 01-19-2013 09:37 AM
Samba - Modify File Date Azhrarn Linux - Software 1 09-06-2005 01:51 PM
Heeelp! How to preserve file date modification attribute Slackovado Slackware 1 03-30-2005 09:36 AM
File Modification Date Comparison MadTurki Programming 7 03-08-2004 04:02 PM
New Samba date modification problem mdkelly069 Linux - Networking 14 01-12-2004 11:42 AM


All times are GMT -5. The time now is 05:26 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration