Jump to content


Photo

[Krydos] Running psql from cron job is failing


  • Please log in to reply
4 replies to this topic

#1 systemcr

systemcr

    Rank I Member

  • Members
  • Pip
  • 22 posts

Posted 11 January 2020 - 06:36 PM

Hi everyone,

 

As I explained in a former post, I'd like to schedule a cron job to run an SQL script on my PostgreSQL database for maintenance stuff.

 

The thing is that I am receiving this error when the cron job is being executed (see image attached).

 

Could anyone help me please?

 

Thanks in advance!

 

 

Screenshot-1.png


Edited by systemcr, 11 January 2020 - 07:18 PM.


#2 yashrs

yashrs

    Rank IX Member

  • Moderators
  • 981 posts
  • Gender:Male
  • Location:India

Posted 11 January 2020 - 06:40 PM

Please attach the error message/image. I think you missed it in the initial post :)



#3 systemcr

systemcr

    Rank I Member

  • Members
  • Pip
  • 22 posts

Posted 11 January 2020 - 07:18 PM

Sorry, done :-)



#4 wolstech

wolstech

    Rank X Member

  • Root Admin
  • 11,471 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 11 January 2020 - 09:35 PM

I’m not sure if this is possible or not. I suspect a permission issue would be the cause if it’s not.

I’ll pass this to Krydos, but is there a reason you can’t just run the sql queries in a php script or something and call the script from the cron? That’s what I do for database maintenance on my systems (though I use MySQL).

Please do not PM me for support. Posting on our forums lets all of us learn.
Do you play Minecraft? | Server Monitors | And the Dumbass of the Decade award goes to...


#5 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 19,356 posts
  • Gender:Male

Posted 11 January 2020 - 10:34 PM

just run the sql queries in a php script or something and call the script from the cron






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users