0

Debian 9, default installation, nothing special, just pure and simple.

I want the file

/var/www/something/check.log

to be deleted every time the system boots.

How?

Juergen Schulze
  • 1,515
  • 21
  • 29
  • Possible duplicate of [How to run a shell script at startup](https://stackoverflow.com/questions/12973777/how-to-run-a-shell-script-at-startup) – Bart Friederichs Feb 28 '18 at 07:57

1 Answers1

0

create a simple script nano /home/user/boot.sh
once inside add this code

#!/bin/bash
rm /var/www/something/check.log

Save the file.
give permissions to that file chmod +x /home/user/boot.sh

now open crontab -e inside add the following line

@reboot /home/user/boot.sh

Save the cron, reboot and report feedback

Diogo Jesus
  • 318
  • 4
  • 19