Hi, I'm running a c program from IBM (http://www.ibm.com/developerworks/linux/library/l-inotify/index.html
) on my Linux machine to monitor a folder.
The command I ran to monitor a folder is...
In a second console, any changes I make to "/home/temp/folderToWatch"
would result in some output in the first console. (From all the printfs in the c program.)
So now I want to save all of the output to a file. I tried to execute the following command...
/root/inotify-sample/inotify_test /home/temp/folderToWatch > /root/watchedFolders/log.txt
But after making changes to the "folderToWatch" folder (add/modify/delete files), there is no output in both the console and "log.txt".
How to save all of the printf output from the c program into a file?
I would also like to run this program in the background, but lets solve the logging part first.