LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-26-2005, 08:32 AM   #1
mariusak
LQ Newbie
 
Registered: Feb 2004
Distribution: Debian 3.0
Posts: 23

Rep: Reputation: 15
Auto Change Date on copy to user folder


Hi!

(Sorry about asking this, but have no clue on what keyowrds I should search for)

I have a samba server on which I'm making backups to. Each backup client has a batch file on their windows system which looks similar to this (user is already logged in):

----------
set drive=Z:
set backupcmd=xcopy /s /c /d /e /h /i /r /k /y

:: START Backup
%backupcmd% "%USERPROFILE%\My Documents" "%drive%\My Documents"
----------

If i use this script to copy files from a windows drive to a windows drive it updates the creation date on the destination to the date and time of when it was copyed. In that way the script can compare source and destination and only copy files that have been modified on source since last backup.

But, when it copies over the the samba server, it keeps the date and time of creation of the file - it is not changed -, resulting in the script to copy ALL files every time the backup is initiated.

How do I tell linux (CentOS 4) to change the time&date on every file which is created in that folder?

I guess I would have to insert something into ".bash_profile" but what?

I would like to "set" the time and date in a smilar way to which you can set umask rights in a folder?

Thanks for any help!

-Marius
 
Old 05-27-2005, 09:30 AM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
the program touch(1) springs to mind; try investigating it to see whether or not it does what you want.
 
Old 05-28-2005, 06:40 AM   #3
mariusak
LQ Newbie
 
Registered: Feb 2004
Distribution: Debian 3.0
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks

Some hours before your post i just found that "keyword" myself, after googeling for wuite some time:-)

But anyway thanks for letting me know!

Any clue on how i can tell it to automatically change all new/modified files?

-Marius
 
Old 05-28-2005, 01:00 PM   #4
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
Quote:
Any clue on how i can tell it to automatically change all new/modified files?
No. Well, not how to do it `the GNU/Linux' way (by use of some file alteration monitor).

But, I have another idea:
1) ssh/telnet onto the linux box
2) mount the windows disk/share/...
2) cd into backup dir
3) run a makefile which copies all the data that should be backed up.

You could of course create a new user (`backup_script_01') which logs into a shell script that does that; then all you have to do is ssh.

hth --Jonas
 
Old 05-28-2005, 06:42 PM   #5
mariusak
LQ Newbie
 
Registered: Feb 2004
Distribution: Debian 3.0
Posts: 23

Original Poster
Rep: Reputation: 15
makefile

okay, i will look into that. Not a bad idea, but i will still first check out if i can do any magic with touch..

Thanks for your reply!

-marius
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete/move/copy files of specific date imsajjadali Red Hat 26 11-07-2013 11:34 PM
Trying to copy a user folder from ntfs hd that is locked. bluedevlx Linux - Security 1 05-18-2005 02:28 PM
grub doesn't auto-load kernel, time/date auto-change, k3b cannot load kenji1903 Red Hat 16 03-27-2005 08:48 PM
Copy files after a certain date davholla Linux - General 2 03-17-2005 09:29 AM
Date-based copy AdmiralThrawn Linux - General 2 02-23-2004 09:03 AM


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