LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-29-2010, 02:36 AM   #1
SilversleevesX
Member
 
Registered: May 2009
Posts: 181
Blog Entries: 9

Rep: Reputation: 15
Monitor when files are copied to another volume and log the date?


I'm pretty sure I'm in over my head with this one.

Here's the situation:
My practice has been, after downloading and making changes to files, to use a certain GUI cataloging app to move them to appropriate categorized sub-folders inside one "umbrella" folder, then copy them to (what are in most cases) identically-named sub-folders in another one on the same HD.

Emulation of this process on the command-line would look like:
Code:
cp holytrousers.jpg /home/metoo/Pictures/fancypants/
mv holytrousers.jpg /home/me/Pictures/pants/
This was in anticipation of making a "twin" of the second, now bigger, "umbrella" folder on anexternal HD and continuing the practice. At some point I intended to get rid of the original 2nd "parent folder" and just keep the first one on the drive with my OS install, using the twin on the backup folder as I'd been doing when it was on that same drive.

I'm very close (a matter of 2 to 3 weeks, it looks like) to getting a backup/external drive in a reasonably-reliable external enclosure. With the backup, originally the "twin" of the bigger "umbrella" folder and its sub-directories, on that other drive, I also anticipate that I will likely go at least a few days between backing up any new files to it.

For the sake of argument, let's say I gave the external the name "tuxs_twin". Is there any way to monitor copying activity from /Pictures/ on the boot HD to /media/tuxs_twin/Pictures/ and log the dates and times, then have something running that checks the log every so many hours and puts up a reminder dialog saying /tuxs_twin/Pictures/ hasn't had any new files copied to it since date X at time Y?

I hope this was clear enough. If not, I'll try to break it down further when I know which details are confusing folks.

BZT

Last edited by SilversleevesX; 07-29-2010 at 02:49 AM.
 
Old 07-29-2010, 04:00 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by SilversleevesX View Post
Is there any way to monitor copying activity from /Pictures/ on the boot HD to /media/tuxs_twin/Pictures/ and log the dates and times
If it needs to be real-time then maybe something based on Inotify, an Auditd rule or FUSE LoggedFS? Else why not use 'rsync'?


Quote:
Originally Posted by SilversleevesX View Post
then have something running that checks the log every so many hours and puts up a reminder dialog saying /tuxs_twin/Pictures/ hasn't had any new files copied to it since date X at time Y?
Like updating the destination using 'rsync' with the "-n" switch?
 
Old 07-29-2010, 08:07 PM   #3
SilversleevesX
Member
 
Registered: May 2009
Posts: 181

Original Poster
Blog Entries: 9

Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
If it needs to be real-time then maybe something based on Inotify, an Auditd rule or FUSE LoggedFS? Else why not use 'rsync'?

Quote:
Originally Posted by unSpawn View Post
Like updating the destination using 'rsync' with the "-n" switch?
I had thoughts along those lines, to tell the truth. A part of my brain said, "This is rsync stuff, but almost in reverse." Because if nothing's changed between the two parent folders, there's nothing to "report" to the user (me), and consequently nothing for rsync to do.

Auditd under/with LoggedFS looks very good for this. I see from the Sourceforge project page that tasks to be monitored are read from editable XML files -- very cool, imo.

Thanks for the suggestions.

BZT

Last edited by SilversleevesX; 07-29-2010 at 08:09 PM.
 
  


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
real last modified date... not when copied to machine mike_stlouis Linux - Newbie 3 08-28-2009 01:17 PM
Script to grep log files based on system date cyclegar Programming 2 05-05-2009 06:08 PM
/var/log/auth.log doens't have correct date and hostname (Solution) alfmarius Linux - Newbie 0 10-07-2008 06:09 AM
how to cat a log starting FROM a date TO a date graziano1968 Linux - General 7 03-21-2007 08:49 AM
Root cannot modify files in any way. Copied files from slackware. CrAzY G Fedora 1 01-08-2007 09:18 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:43 PM.

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