SitePoint Sponsor

User Tag List

Page 4 of 4 FirstFirst 1234
Results 76 to 81 of 81
  1. #76
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    314
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Small Windows OS modification for this tool

    Great tool, easy to use and understand

    I was investigating the script to ensure it could support both Windows and Linux. As it seems, the current script is ready for linux or compatible.

    Would there be any issue by changing:

    PHP Code:
    if ($remove_sql_file== "yes") { 
          
    exec("rm -r -f $filename"); 

    To this:

    PHP Code:
    if ($remove_sql_file== "yes") { 
          
    //exec("rm -r -f $filename"); 
          
    if (file_exists($filename)) {
               
    unlink($filename);
          }

    AND:

    PHP Code:
    if($remove_gzip_file=="yes") { 
    exec("rm -r -f $filename2"); 

    To this:

    PHP Code:
    if ($remove_gzip_file == "yes") { 
          
    //exec("rm -r -f $filename2"); 
          
    if (file_exists($filename2)) {
        
    unlink($filename2);
          }

    To support both Windows/Linux? Would this be the best way? For this tool I'd only be interested in obtaining the .gz of the DB dump sent to my email address and never leave the archives on the server (at all). For this, I'd want to ensure the backup tool could handle both Windows/Linux in terms of removing the file(s) or dumps after the email (with attachment) has been sent.

    Any suggestions would be appreciated

    Thanks

  2. #77
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lance,

    As posted in another post, the 127 error means that the command was not found. Are you using the full path to the file?

    Quote Originally Posted by From PHP User Note
    Remember to use the full path (IE '/usr/local/bin/foo' instead of 'foo') when using passthru, otherwise you'll get an exit code of 127 (command not found).

    Remember, you'll also get this error if your file does not have executable permission.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  3. #78
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by psalzmann
    To support both Windows/Linux? Would this be the best way? For this tool I'd only be interested in obtaining the .gz of the DB dump sent to my email address and never leave the archives on the server (at all). For this, I'd want to ensure the backup tool could handle both Windows/Linux in terms of removing the file(s) or dumps after the email (with attachment) has been sent.
    I don't think there should be any problems using file_exists and unlink in any OS as long as you provide the full path to the respective directory.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  4. #79
    SitePoint Member
    Join Date
    Dec 2003
    Location
    010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation

    how i can make it work in Safe_Mode ?

    bouth , Dumb and restore ?

  5. #80
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry but I can't think of anything to make this work in Safe Mode since pretty much every function that is able to execute commands is disabled or restricted.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  6. #81
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As others have mentioned you can set up a cron job to run a script. I would suggest having the cron job to :

    1) run mysqldump --- to dump the database into a file

    2) run zip with recursion to compress the mysqldump file and the entire site into one zip file that is stored in an .htaccess protected folder.

    3) Run a PHP script that notifies your client that the backup file has been created and create a link where they can http download the file, from a folder that is password protected (.htaccess) . Of course, give your client the user id and password and the download will start automatically.


    I know this is an old thread, but thought I would throw in m two pence worth.
    intragenesis, llc professional web & graphic design


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •