1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP script to email DB backups WITHOUT f_open

Discussion in 'PHP' started by dakar, Apr 5, 2006.

  1. #1
    Okay I have cron jobs running mysqldumps on all of my databases which works fine however now I'm looking for a way to have either the same script (or another) pickup the new db archive and email it off so I have an offsite backup of them. Simple enough to set up an email and pickup the attachments, however the tricky part is my host has completely disabled the f_open portions of PHP so the easy way is out.

    Anyone got any coding suggestions using something like curl to pick up the file(s) to send off?
     
    dakar, Apr 5, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Slapyo, Apr 5, 2006 IP
  3. dakar

    dakar Active Member

    Messages:
    203
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #3
    I have my DB's automatically getting backed up each night without issue, the issue is getting php to actually email me the backup file... I haven't been able to find away to attach a file to an email without using fopen.

    I'm just trying to automate things a little better than having to use a cron job to wget then backups down to another server, using one of my IMAP servers seemed the easiest way to store them.
     
    dakar, Apr 14, 2006 IP
  4. inerte

    inerte Peon

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    fopen() might be disabled but what about file()? Or maybe if you base_64_encode() it and pass the string on the email?
     
    inerte, Apr 14, 2006 IP
  5. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #5
    exam, Apr 22, 2006 IP
  6. dakar

    dakar Active Member

    Messages:
    203
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #6
    Thanks, I'll check it out!
     
    dakar, Apr 23, 2006 IP
  7. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes, It really simplifies adding attachments etc.
     
    exam, Apr 23, 2006 IP