Home Forums OS X Server and Client Discussion Questions and Answers mount_afp, crontab, and php

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #378370
    paulstanely45
    Participant

    Hello,

    I am using Mac OS Server 10.5.8

    I have been having one hell of a time figuring out this one bug. I have been trying to write a script that backups my mysql databases. It worked for the longest time, but now I can an error like this, and I can’t seem to figure out why I am getting it.

    2010-04-09 17:28:33.812 mount_afp[7458:613] CFPreferences: user home directory at /Library/WebServerBackup/99 is unavailable. User domains will be volatile.
    mount_afp: AFPMountURL returned error 1, errno is 1

    I am using the crontab to run the script, and that is when it fails. If I run it manually, it works just fine.

    The app essentially mounts the drive, copies mysql data to the drive, and then unmounts it.

    Can anyone shed some light on what is happening. I am using a php call to mount_afp:

    exec(“sudo mount_afp -f afp://backup:[email protected]/backup $mount_path”, $mount_output);

    I have a full script posted at the following link if anyone feels it would help.

    [url]http://forums.devnetwork.net/viewtopic.php?f=6&t=115128[/url]

    #378379
    khiltd
    Participant

    Why are you using PHP to run a shell script when you could just run the shell script?

    #378398
    paulstanely45
    Participant

    I don’t think I would know how to get a shell script to back up each database individually :\

    Plus, I need to be able to send out e-mail notifications

    #378400
    paulstanely45
    Participant

    I tried running a shell script to do the same thing and no luck

    If I have the crontab actually run the command mount_afp, it runs the command and mounts the drive. However, if I put the command inside a php script or inside a shell script it fails to execute properly.

    #378410
    khiltd
    Participant

    Have your script log the output of whoami and see if it matches what you would expect to see.

    The bottom line is that cron and PHP are simply the wrong tools for this job.

    #378411
    paulstanely45
    Participant

    what would you recommend I use?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Comments are closed