Delete a files contents through bash


So I was looking for a way to automatically overwrite a log file utilizing the command prompt and a cron job.  So this is how it can be accomplished.

By adding this to the crontab it will overwrite the file at whatever interval you set.  Very useful if a sites log file is getting filled up with warnings.

Submit a Comment

Your email address will not be published. Required fields are marked *