Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Technical

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 30th November 2009, 08:54
mixo mixo is offline
Junior Member
 
Join Date: Aug 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to run inotifywait background

Hello.
I want to run Inotifywait background.
I use:
nohup inotifywait -rm --timefmt "%Y %B %d %H:%M" --format "%T =-= %e %w%f" -e create,delete,move /somefile1 >> /somefile2

then type ctl+Z and bg and it runs background.
But when I type such a way:
nohup inotifywait -rm --timefmt "%Y %B %d %H:%M" --format "%T =-= %e %w%f" -e create,delete,move /somefile1 >> /somefile2 &
and bg, it doesn't work.It moves background and stops,doesn't run.
How can I run inotifywait background with & symbol?
Reply With Quote
Sponsored Links
  #2  
Old 1st December 2009, 18:55
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Try this:

Code:
nohup inotifywait -rm --timefmt "%Y %B %d %H:%M" --format "%T =-= %e %w%f" -e create,delete,move /somefile1 >> /somefile2 &> /dev/null &
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 2nd December 2009, 13:06
mixo mixo is offline
Junior Member
 
Join Date: Aug 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

thanks falko.

It sends log to /dev/null.
So I use:

Code:
nohup inotifywait -rm --timefmt "%Y %B %d %H:%M" --format "%T =-= %e %w%f" -e create,delete,move /somefile1 > /dev/null &> /somefile2 &

Can anybody explain why it needs two redirection, ">" ?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to run a server behind multiple routers which I do not have admin access to. Jrdgames Technical 4 24th April 2008 05:56
how to run jar file using cron? shoaibahmedbaig HOWTO-Related Questions 1 9th February 2008 19:10
Autoresponder installation problem cgi script won't run MikeM Installation/Configuration 8 14th September 2007 18:52
Make webstats run mphayesuk General 1 20th September 2006 19:14
Cannot run systemimager KCPoole HOWTO-Related Questions 1 6th May 2006 16:02


All times are GMT +2. The time now is 05:04.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.