Empty a file in place.
#!/bin/sh truncate -s 0 $1 # example, to erase the logs: # sudo truncate -s 0 /var/log/apache2/* # sudo truncate -s 0 /var/log/nginx/*