Cronjob for recognizing changes and/or new files in specific directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cronjob for recognizing changes and/or new files in specific directory
# 1  
Old 02-03-2010
Cronjob for recognizing changes and/or new files in specific directory

Hey Guys,
is there a way to create a cronjob to watch over all changes in a specific directory, for example /home/user and send them, if there are any changes, to a serverSmilie

Thanks

Sebi0815
# 2  
Old 02-03-2010
Can't you just rsync everything with cronjob?
# 3  
Old 02-03-2010
Thanks for the fast answer,

no, I really need a cronjob. This cronjob is part of a system for foresic-it-education, and the students should recognize that there is a cronjob that somehow does strange things and I hope they will recognize it if they check the crontab...

Last edited by Sebi0815; 02-03-2010 at 11:28 AM..
# 4  
Old 02-03-2010
Well. You will have a cronjob that will sync two folders using rsync ... .

You can write a timestamp of each file to some temporary place. Or sha256 hashes. Next round you compare this and if this differs - do something (copy the file).

However rsync will do quite the same faster and better. Smilie
# 5  
Old 02-03-2010
Ahhhh,

that should work. I didn't know rsync, but found a good tutorial... Thanks for your support...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurrence of a specific word

he following are the files available in my directory RSK_123_20141113_031500.txt RSK_123_20141113_081500.txt RSK_126_20141113_041500.txt RSK_126_20141113_081800.txt RSK_128_20141113_091600.txt Here, "RSK" is file prefix and 123 is a code name and rest is just timestamp of the file when its... (7 Replies)
Discussion started by: kridhick
7 Replies

2. Shell Programming and Scripting

How to copy a directory without specific files?

Hi I need to copy a huge directory with thousands of files onto another directory but without *.WMV files (and without *.wmv - perhaps we need to use *.). Pls advise how can I do that. Thanks (17 Replies)
Discussion started by: reddyr
17 Replies

3. UNIX for Dummies Questions & Answers

How to search all the files in a directory for a specific string

Hi Guys, I want to search the content of all the files (of a particular type like .txt) in a directory for a specific string pattern. Can anyone help me? Thanks (7 Replies)
Discussion started by: mwrg
7 Replies

4. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurence of a specific word

Hello, I have several files in a specific directory. A specific string in one file can occur in another files. If this string is in other files. Then all the files in which this string occured should be deleted and only 1 file should remain with the string. Example. file1 ShortName "Blue... (2 Replies)
Discussion started by: premier_de
2 Replies

5. UNIX for Dummies Questions & Answers

Splitting files into a specific directory

Hello, I am trying to do the following; bzcat data.in.bz2 | split -l 1000000 -d this work great, except that once the files have been split, they are not in the directory I want them to be in. So I then have to move them, at times this can get hairy. Is there anyway to specify where the... (4 Replies)
Discussion started by: amcrisan
4 Replies

6. Shell Programming and Scripting

How to find a specific files in a many directory

Dear All, Appreciate some help here. I have a log of report. It located in several directory as below: Directory: mysscpr1 mysscpr2 mysscpr3 my_scnpr4 In the directory it contain hundred of files. i need to find a specific files that contain 'invc2345' in the directory. How... (7 Replies)
Discussion started by: selamba_warrior
7 Replies

7. UNIX for Dummies Questions & Answers

deleting specific lines from all files in a directory

I have a directory full of text data files. Unfortunately I need to get rid of the 7th and 8th line from them all so that I can input them into a GIS application. I've used an awk script to do one at a time but due to the sheer number of files I need some kind of loop mechanism to automate... (3 Replies)
Discussion started by: vrms
3 Replies

8. Solaris

List all files that contain a specific directory

I need to list all files and subdirectories that contain "oradata". For example, I have several files in several different directories that contain "oradata". I.e. /u07/oradata/1.dbf /u09/unix/whatever/oradata/2.xxx That is, whatever file on the system that contains a directory called... (7 Replies)
Discussion started by: Sat510
7 Replies

9. Shell Programming and Scripting

delete files in specific directory

i have a directory "ABC" with lots of old files and sub directories in it. the issue now is i want to delete away files which are older than 15 days in "ABC" without deleting the files in the sub directories and without deleting the sub directory. i tried using find command but it will drill down... (2 Replies)
Discussion started by: legato
2 Replies

10. Programming

creating object files in a specific directory

hello, i have a makefile in which i am specifying the option for creating the object files of the source files. The option which i am using is this : gcc -c main.c first.c by default these object files are created in the same directory in which the makefile is present. what option... (1 Reply)
Discussion started by: svh
1 Replies
Login or Register to Ask a Question