I have a bash script that is like this:
If I run the script locally it works correctly. If I schedule it via root crontab job per the cron log it runs but doesn't actually delete the files like it should.
Any Ideas why it runs manually but via cron it doesn't delete any files?
Also on another side note, obviously this is being used to delete all email in a users inbox. Is this a proper way to do this or should I be performing this task a different way?
Code:
#!/bin/bash
rm -rf /home/domain/mail/domain.com/user/cur/*
rm -rf /home/domain/mail/domain.com/user/maildirsize
Any Ideas why it runs manually but via cron it doesn't delete any files?
Also on another side note, obviously this is being used to delete all email in a users inbox. Is this a proper way to do this or should I be performing this task a different way?