Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 663009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:26:32+00:00 2026-05-13T23:26:32+00:00

I am trying to make a Postgres PHP backup script. I have downloaded one

  • 0

I am trying to make a Postgres PHP backup script. I have downloaded one for the command line which looks like this:

#!/bin/bash
find /home/russell/pg_bkp -type f -mtime +7 -exec rm {} \;
time=`date +%Y-%m-%d`; # date in reverse so that lastest date appears last in the list of backup files.
PGPASSWORD=****** pg_dump -i -h localhost -p 5432 -U postgres -F c -b -v -f "/home/russell/pg_bkp/$time.backup" ah3

How can I implement this in PHP? The extension that this creates is .backup. It works great and have used it many times. the data is perfect, but doing it from inside my website would be better. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:26:32+00:00Added an answer on May 13, 2026 at 11:26 pm

    Please, format better the code.

    For your question, you can save those command in a file, and then call it throught php via exec or passthru.

    In php, you can even write the command with the special apostrophes, `, and it will be executed.

    Just make sure the PHP service has the permission to run that script

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 502k
  • Answers 502k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm not sure you can do that via the browser… May 16, 2026 at 2:35 pm
  • Editorial Team
    Editorial Team added an answer Come across this myself - here are some links... to… May 16, 2026 at 2:35 pm
  • Editorial Team
    Editorial Team added an answer Probably you should use jQuery.getScript to loading some javascript from… May 16, 2026 at 2:35 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

im trying make one replace in string from a array but this dont work
Ok so I'm trying to hack together something to make SubSonic3 work with Postgres,
I'm trying to make Vim run the command 'CommandTFlush' whenever a new file is
I'm trying to make restricted DB users for the app I'm working on, and
I am trying to retrieve a blob from a postgres database using the jdbc
I'm trying make a simple control, with a some path in it. And binding
I am trying make long screen to vertical direction. So, I need a screen
I'm trying make a <dl> to define the icons I am using on the
Im trying to make an swf send a phone-number to a specific asp-fil on
So Im trying to make an object dynamically, please see below code from my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.