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 7841141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:02:10+00:00 2026-06-02T16:02:10+00:00

I run a script in one of my php files that dumps a specific

  • 0

I run a script in one of my php files that dumps a specific database which works fine, but it puts the created file in the directory where the scripts is called. How can I make it to store the file in a specific directory? (e.g /blahblah/backups)

Here’s the code (the connection code is not included but you get the idea)

system("mysqldump -h $pdb_server -u $pdb_user -p$pdb_pwd $pdb_name > $backupfile");

could I just add

/path/to/output/$backupfile
  • 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-06-02T16:02:14+00:00Added an answer on June 2, 2026 at 4:02 pm

    Put the Path before the command:

    system("cd /path/to/output/$backupfile; mysqldump -h $pdb_server -u $pdb_user -p$pdb_pwd $pdb_name > $backupfile");
    

    or

    system("mysqldump -h $pdb_server -u $pdb_user -p$pdb_pwd $pdb_name > /path/to/output/$backupfile");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created one ruby script that I want to run with some flags
I,m trying to run one php script in background. But its no working... I
I am setting up a cron job to run a single PHP script which
i use xampp apache to run some of my php files. In one of
I have a PHP script that needs to download several files from a remote
i am using PHP to run exec() on a script which looks like this:
i have a php script which should upload files upto 1GB to server. i
I am writing a php script which will run through cron . Its task
I want to run a javascript one time. I tried using a script from
I am trying to run a small javascript script. one of the parameters of

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.