I would like to set up a cron job that recusively does a chmod/chown on a directory (the dropbox directory).
This works when I execute the commands manually like:
sudo chown -R $USER ~/Dropbox
sudo chmod -R u+rw ~/Dropbox
I tried to convert it into a cron job like this:
10 * * * * sudo chown -R $USER ~/Dropbox
But it doesn’t seem to do the job.
How to do this?
You want your root cron script (edit by running sudo crontab -e
) to be:
55 * * * * /bin/chown -R somename /home/somename/Dropbox && /bin/chmod u+rw /home/somename/Dropbox
Assuming the user is named somename
and that /home/somename/Dropbox
is the full path of your Dropbox directory. As root user, ~ goes to /root
.
Check more discussion of this question.