Can not create cron job fole

Hi ,
I am installing owncloud by Install ownCloud on Ubuntu 18.04 with quick installation guide
Quick installation

I am trying to setup cron job with this command as it said in site

echo “*/15 * * * * /var/www/owncloud/occ system:cron” > /var/spool/cron/crontabs/www-data

but i get below message

bash: /var/spool/cron/crontabs/www-data: Permission denied

i ran it with putting sudo before echo but the error is still is there

what should i do?

Run the command as user "www-data". By default the file is only accessible by the owner (which is www-data).

1 Like

Thank you , i am new in linux i ran this command as an example

su - www-data -c 'ls /var/spool/cron/crontabs/'

to see the output but ask me for user password , as i know this user create automatically , should i get or set password for user? or there is another way to get the result?

can you tell me how to run this command with the user you mentioned

echo “*/15 * * * * /var/www/owncloud/occ system:cron” > /var/spool/cron/crontabs/www-data

again thank you for your help

@farazb59 For me, the cited documentation implies, even if not very clearly, the all the installations tasks should be run as root.

Try login as root, or sudo su, if it works for you.

1 Like

Thank you very much , it works with sudo su and file created

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.