CRONJOB to delete auto-generated files

mousepotatoe

Active Member
Dec 17, 2003
36
0
156
I run CRON every 30 minutes on many of my websites that processes the websites scripts, but every time it runs, it creates a file in /home/username/
as you see below..

./ send.php.10 send.php.21 send.php.32 send.php.43 send.php.7
../ send.php.11 send.php.22 send.php.33 send.php.44 send.php.8
.contactemail send.php.12 send.php.23 send.php.34 send.php.45 send.php.9
.cpanel-ducache send.php.13 send.php.24 send.php.35 send.php.46 .spamkey
etc/ send.php.14 send.php.25 send.php.36 send.php.47 tmp/
.lastlogin send.php.15 send.php.26 send.php.37 send.php.48 .trash/
mail/ send.php.16 send.php.27 send.php.38 send.php.49 [email protected]
.neomail/ send.php.17 send.php.28 send.php.39 send.php.5
public_ftp/ send.php.18 send.php.29 send.php.4 send.php.50
public_html/ send.php.19 send.php.3 send.php.40 send.php.51
send.php* send.php.2 send.php.30 send.php.41 send.php.52
send.php.1 send.php.20 send.php.31 send.php.42 send.php.6

How can i create a single cronjob that will delete these files once a day?
It would have to be something like
del /home/*/send.php.*
but I cant quite figure it out..

Any help would be appreciated..
 

mousepotatoe

Active Member
Dec 17, 2003
36
0
156
Cronjob to delete files..

Yes it would be better, but the cron code is encrypted and uneditable by me, so that part is out of my hands.

:rolleyes:
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
That would be tricky ;)

OK, this will do it, but use with extreme care:

find /home/ -name send.php.* -maxdepth 2 | xargs rm -Rfv

Probably best to test it beforehand with:

find /home/ -name send.php.* -maxdepth 2 | xargs ls -la
 

mousepotatoe

Active Member
Dec 17, 2003
36
0
156
Excellent!

Thank you so much, thats perfect :D