Periodical Updating from Crontab

If you run tt-rss on an officially unsupported platform (shared hosting, Windows, etc.) post here
SOV
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 13 Jun 2014, 02:41

Periodical Updating from Crontab

Postby SOV » 13 Jun 2014, 04:06

SOLVED by JustAMacUser
The SSH code I needed was "/usr/local/php53/bin/php /home/user/mydomain.com/rss/update.php --feeds --quiet"
Cron Job is working now!
I couldn't have done it without JustAMacUser


I'm using an unsupported service, a shared hosting site, DreamHost.

DreamHost provides a Cron Job tab, which I will eventually set up, but currently I am using SSH to see if the command works, which it's failing and that's where I need assistance.

Per the UpdatingFeeds wiki the code is:

Code: Select all

*/30 * * * * /usr/bin/php /home/user/public_html/tt-rss/update.php --feeds --quiet


I'm attempting the command below but it is failing:

Code: Select all

/usr/local/php5/bin/php /home/myuser/mydomain.com/tt-rss/update.php --feeds --quiet


I was instructed by DreamHost's support that php is located in the "/usr/local/php5/bin/php" directory, hence the change.

The error I am receiving is:

Code: Select all

Could not open input file: /home/myuser/mydomain.com/tt-rss/update.php



Any help would be great.


Image
Last edited by SOV on 13 Jun 2014, 08:14, edited 1 time in total.

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Periodical Updating from Crontab

Postby JustAMacUser » 13 Jun 2014, 06:15

Make sure the update.php file exists at the path specified. Make sure ownership and file permissions are set correctly.

SOV
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 13 Jun 2014, 02:41

Re: Periodical Updating from Crontab

Postby SOV » 13 Jun 2014, 06:28

JustAMacUser wrote:Make sure the update.php file exists at the path specified. Make sure ownership and file permissions are set correctly.



I checked and I have permissions to allow update.php to execute and everything. But I'm still getting the same error. Unless I'm fat fingering the directory, but it looks to be correct.

charlie-tca
Bear Rating Trainee
Bear Rating Trainee
Posts: 32
Joined: 03 May 2013, 23:04
Contact:

Re: Periodical Updating from Crontab

Postby charlie-tca » 13 Jun 2014, 06:52

I could be wrong, but I think the path is wrong. Is "mydomain.com" really there, or is it supposed to be "mydomain"? On my own websites, even though the url includes .com , the path does not.

SOV
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 13 Jun 2014, 02:41

Re: Periodical Updating from Crontab

Postby SOV » 13 Jun 2014, 06:57

charlie-tca wrote:I could be wrong, but I think the path is wrong. Is "mydomain.com" really there, or is it supposed to be "mydomain"? On my own websites, even though the url includes .com , the path does not.

I just tried just "mydomain" but it didn't work

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Periodical Updating from Crontab

Postby JustAMacUser » 13 Jun 2014, 07:11

SOV wrote:I checked and I have permissions to allow update.php to execute and everything. But I'm still getting the same error. Unless I'm fat fingering the directory, but it looks to be correct.


Well, the error states it can't open the file. Either the file doesn't exist or cannot be read. What happens when you type:

Code: Select all

ls -la /home/myuser/mydomain.com/tt-rss/update.php

SOV
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 13 Jun 2014, 02:41

Re: Periodical Updating from Crontab

Postby SOV » 13 Jun 2014, 07:20

JustAMacUser wrote:
SOV wrote:I checked and I have permissions to allow update.php to execute and everything. But I'm still getting the same error. Unless I'm fat fingering the directory, but it looks to be correct.


Well, the error states it can't open the file. Either the file doesn't exist or cannot be read. What happens when you type:

Code: Select all

ls -la /home/myuser/mydomain.com/tt-rss/update.php



You're on to something. I tried your command and permission denied came up. Part of my confusion comes from the way DreamHost has "users" set up.

I'll give you an example.

the ftp path for the file user is "user1" but the user I use to ssh is "user2". I edited the actual update.php to allow executable and all permissions.

But I don't know how to fix the permissions

EDIT: Does it matter what shell type I select when creating a user to be able to SSH? It's currently set to "/bin/bash/" in the WebPanel

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Periodical Updating from Crontab

Postby JustAMacUser » 13 Jun 2014, 07:37

I have previously used DreamHost and I'm not sure I'm following what you're saying with users. You create a user, then when you add a domain you add it to a specific user. You login with that user to manage the domains added to it. (Unless you're doing what DreamHost calls "advance" user setups where you create groups, etc. to allow multiple users access.)

Either way, login as the actual owner of the file, then run the command. If it works, great. Then you simply create a cronjob for the user who owns the file.

A bash shell is fine.

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Periodical Updating from Crontab

Postby JustAMacUser » 13 Jun 2014, 07:43

Also, .php files don't need the executable flag and, quite honestly, they should not have it. Permissions of 600 (rw-------) or 640 (rw-r-----) should be fine. With shared hosting, you might need to use 644 (rw-r--r--). But try them in the order I've listed them and stop when one works.

SOV
Bear Rating Trainee
Bear Rating Trainee
Posts: 15
Joined: 13 Jun 2014, 02:41

Re: Periodical Updating from Crontab

Postby SOV » 13 Jun 2014, 07:48

JustAMacUser wrote:Also, .php files don't need the executable flag and, quite honestly, they should not have it. Permissions of 600 (rw-------) or 640 (rw-r-----) should be fine. With shared hosting, you might need to use 644 (rw-r--r--). But try them in the order I've listed them and stop when one works.


Ok I got a new error, so I'm getting somewhere.

syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home/user/domain.com/rss/update.php on line 335

EDIT: Line 335 in update.php is "$tmppluginhost->load_all($tmppluginhost::KIND_ALL);"

EDIT2: After searching that error I found the solution. I had to point to php5.3 specifically from Dreamhost, which is /usr/local/php53/bin/php/

Thank you so much for helping JustAMacUser! All is working now!

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Periodical Updating from Crontab

Postby JustAMacUser » 13 Jun 2014, 08:24

You're welcome. Glad it works.


Return to “Unsupported platforms”

Who is online

Users browsing this forum: No registered users and 2 guests