This is a Python script that deletes files in a specified directory that are older than a certain number of hours.
To use OldFileGone with Loop, simply download the oldfilegone.py file and save it to a directory of your choice. Make sure you have Python 3 installed on your system.
To use this script, follow the steps below:
- Open the
OldFileGone.py
file in a text editor. - Modify the
dir_path
,loop_sleep_time and
hour
variables in themain()
function to specify the directory path and the number of hours that files older than which should be deleted, respectively. - Save the changes to the
OldFileGone.py
file. - Open a command prompt or terminal and navigate to the directory containing the
OldFileGone.py
file. - Run the script by typing
python OldFileGone.py
in the command prompt or terminal.
The script will run and delete any files in the specified directory that are older than the specified number of hours.
- Automatically deletes files in a specified directory that are older than a certain number of hours
- Easy to use and configure
- Customizable directory path, time interval, and loop sleep time
- Lightweight and fast
- Compatible with Python 3
This script is released under the MIT license. See the LICENSE
file for more information.