Jump to content

Help with restarting a script.


Recommended Posts

Hi, I need some help. Have searched the forum but not found anything.

What I would like to do with this script that logs systeminfo, such as running processes is to have it to restart say like once every hour so that I can get the logs sent to me every hour. Will use it as a tool to monitor our computers to detect unusual services such as running trojans and other type of malware. But instead of manually checking each and other computer I will have it send the logs to our fileserver.

But I can't seem to find out how to make the script restart itself every hour.

Now, some might ask why I want it to send every hour and that it will be a lot of logs and yes, but I have another script on the server that centrally checks these logs for changes, so if there is a new service running in one computer it will notify me :)

Here's the script that I need help with to get restarting every hour.

_SysInfoLog_v2.07.au3

Link to comment
Share on other sites

Well if you are going to write a script to run a script, you might as well

just have a function in the main script to execute every hour.

See AdLibRegister() <- helpfile.

Or use windows task scheduler.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Why do you want to restart your script.

Use AdLibRegister to run a function every hour. This function closes the file and sends it to the file share, then reopens it.

I would do it the other way round. Have a list of "allowed" processes in a file on the fileshare. Read this file every hour by the client and check the running processes in a short interval (every minute). If you find a process which isn't allowed send a messge to the admin.

This way an invalid process is much faster identified and you can act much faster.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Why do you want to restart your script.

Use AdLibRegister to run a function every hour. This function closes the file and sends it to the file share, then reopens it.

I would do it the other way round. Have a list of "allowed" processes in a file on the fileshare. Read this file every hour by the client and check the running processes in a short interval (every minute). If you find a process which isn't allowed send a messge to the admin.

This way an invalid process is much faster identified and you can act much faster.

That's a good idea :) I'm new to all this about AutoIt but learning every day :) So thanks for the tip.

/ Marculito

Link to comment
Share on other sites

This approach has the advantage that the processing is distributed and that you can act much faster when a new unwanted process shows up.

Like all the virus scanners do. Get the virus database from a central server and do the processing on each machine.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...