LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2015, 03:13 PM   #1
vrecalde
LQ Newbie
 
Registered: Dec 2014
Posts: 8

Rep: Reputation: Disabled
Run .bat file on Windows that depends on an event in Linux


Hello, does anyone knows a way to run a .bat file in windows that depends on an event in Linux? I already have a free communication between both machines, with puttyGen, but now i have to activate a .bat file in windows when a directory in linux contains files. By crontab it will be watching that directory, and at the moment that a file arrives, the .bat file that is in windows has to fire.

Thanks for the information.
 
Old 01-13-2015, 03:17 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,029

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
this is more of a windows question.

i think if you can set up ssh (or maybe even telnet) on windows then you can just log in normally to execute it but i am not sure how to hax windows to have that functionality.
 
1 members found this post helpful.
Old 01-13-2015, 03:24 PM   #3
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 808

Rep: Reputation: 216Reputation: 216Reputation: 216
Quote:
Originally Posted by vrecalde View Post
By crontab it will be watching that directory
For this part of your question also have a look at inotify tools. Would be a better way then polling through cron.
 
1 members found this post helpful.
Old 01-13-2015, 03:25 PM   #4
vrecalde
LQ Newbie
 
Registered: Dec 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
Ok thanks schneidz, i am searching something in the internet, if i found something helpful iŽll let you know.
 
Old 01-13-2015, 03:28 PM   #5
vrecalde
LQ Newbie
 
Registered: Dec 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
very interesting joe, right now iŽll see how that works.
 
Old 01-13-2015, 03:28 PM   #6
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,028

Rep: Reputation: 1623Reputation: 1623Reputation: 1623Reputation: 1623Reputation: 1623Reputation: 1623Reputation: 1623Reputation: 1623Reputation: 1623Reputation: 1623Reputation: 1623
I think there are ways of watching "folders" in Windows too so how about having the Linux machine drop and empty file in a location that Windows is monitoring? Sorry, been a while since I did any sys admin work so I don't recall any specifics of what to google for in Windows to watch a folder.
 
Old 01-13-2015, 07:52 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531
Quote:
Originally Posted by vrecalde View Post
Hi have to activate a .bat file in windows when a directory in linux contains files. (..) at the moment that a file arrives, the .bat file that is in windows has to fire.
If you already have SSH working both ways then why not have have an inotifywait script or incron job drive batch file execution via SSH?..
 
1 members found this post helpful.
  


Reply

Tags
batch, event, linux, windows, windows 7


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run bat file from Unix script??? gopi_20us Programming 10 09-14-2010 10:15 AM
Run BAT or EXE from WINDOWS on UNIX npati General 5 02-13-2008 05:00 PM
Does linux run bat files like DOS oldgi Linux - Software 6 07-05-2007 12:47 PM
linux bat file? Shalk Linux - General 3 07-26-2005 11:07 AM
how to run the *.bat file ztdep Linux - Software 8 07-19-2005 05:36 PM


All times are GMT -5. The time now is 01:22 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration