crontab A job is performed to generate XML data, and the generated data permissions are all root, and the file permissions you want to generate are now WWW, and the previous scripts are like this:
30 06 * /opt/a > /dev/null 2>&1
To generate www permissions, as long as this:
30 06 * su – www /opt/a > /dev/null 2>&1 ?
It’s not really good. After the file is generated, revise the ownership
/2 * root /opt/a > /dev/null 2>&1
30 06 * www /opt/a > /dev/null 2>&1
In addition to the planning task, the above plan is carried out, and another chown.
crontabIt is aimed at users (each user has his own crontab), and your needs are cron (note no tab).
UbuntuThe words can be in
/etc/cron.dNext to the new file (CentOS and other systems, please explore the same type), the format of the task is basically the same as the crontab, just before the command a specified user name to run the command. as
* * * * * user /path/to/file
userIt is to execute
/path/to/fileThe user identity, if you want to run as root, is here.
Reboot after saving the file
crondThe service is all right.