So, I run an overnight python script that runs a backup of our web data in the /var/www directory, then moves the backups to an external HDD in /media. The script in scheduled in the sudo crontab since it requires sudo commands.
The script runs fine most everynight but once a week, the external HDD directory somehow gets it permissions changed from being accessible to all users to only being accessible to the root user. This causes our backups to fail, and this is no good. To further explain:
the directory, /media/ gets duplicated into /media/_ which has no permission issue. It's like the name just got changed to have an underscore at the end. This one has all of the right data in it and is fine. The root one (/media/) is actually empty when I get in there.
I am not heavily experienced with linux. I just know how to get around and issue simple commands. I do not know the ins and outs of the kernel and what could be causing the issue. I have no clue what is going on here. I am open to any suggestions. Please let me know if I am doing anything wrong/insecure.
Let me know if this needs to be further explained.