Jump to content

Help Needed On Back Up Script


Recommended Posts

I'm hoping someone can tell me where I am going wrong.


I am trying to set a cron job to back-up a folder of jpegs on a daily basis - to a zip file.


I am using the script mentioned by TCH-Bruce, but am getting the following error.


>/home/busybea/backupscript.php: line 1: ?php: No such file or directory
/home/busybea/backupscript.php: line 2: //: is a directory
/home/busybea/backupscript.php: line 3: //: is a directory
/home/busybea/backupscript.php: line 3: PHP: command not found
/home/busybea/backupscript.php: line 4: //: is a directory
/home/busybea/backupscript.php: line 6: syntax error near unexpected token `|'
/home/busybea/backupscript.php: line 6: `// |


Can anyone tell me what is wrong?


My original PHP script starts with:


>// setup variables
$remove_file = "no";  // remove file when done -- recommended!

$path= '/home/username/folder full of pics/';  // Full path to backup

$zipfile = "your.zip";  // backup file name
$zippath = "/home/username/folder full of pics";  // path to save backup file

$send_email = "no";  // Do you want this backup sent to your email? Fill out the next 2 lines
$to	  = "you@yourdomain.ext";  // Who to send the emails to
$from	= "backup@yourdomain.ext"; // Who should the emails be sent from?

$senddate = date("j F Y");

$subject = "Backup - $senddate"; // Subject in the email to be sent.
$message = "Your backup is attached to this email"; // Brief Message.

$use_ftp = "no"; // Do you want this backup uploaded to an ftp server? Fill out the next 4 lines
$ftp_server = "localhost"; // FTP hostname
$ftp_user_name = ""; // FTP username
$ftp_user_pass = ""; // FTP password
$ftp_path = "/"; // This is the path to upload on your ftp server!

// Do not Modify below this line!


and I haven't changed anything else.


thank you


Link to comment
Share on other sites

>$zippath = "/home/username/folder full of pics";


This needs to be the full path from /home so it should include /home/your-user-id/public_html/other-folder


And hopefully you didn't remove the <?php on the very first line.


Thank you for your help, but I thought I had all that. Anyway, some nice support person must have looked into it for me as I see that they have changed the cron command and now it works (hurray).


Thank you whoever it was.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...