This Python script periodically logs information about all running processes on the system and sends the log file through email. The script uses psutil
for process information, schedule
for scheduling tasks, and smtplib
for sending emails.
- Periodic Logging: Logs running processes at user-defined intervals.
- Log File Creation: Creates a log file in the
Marvellous
directory. - Email Notification: Sends the log file via email.
- Internet Connectivity Check: Checks for internet connectivity before sending the email.
- Python
psutil
for process informationschedule
for task schedulingsmtplib
for email functionality
- Python 3.x
- Required Python packages:
psutil
schedule
-
Clone the repository:
git clone https://github.com/your-username/your-repository.git cd your-repository
-
Create and activate a virtual environment:
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install the required dependencies:
pip install psutil schedule
To run the script, provide the time interval in minutes as a command-line argument:
python your_script.py <interval>