The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remote FTP backup cron - how can i make it retry until successful?

Discussion in 'General Discussion' started by dansgalaxy, Nov 28, 2008.

  1. dansgalaxy

    dansgalaxy Well-Known Member

    Joined:
    Jan 29, 2007
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Reading, UK
    cPanel Access Level:
    Root Administrator
    Hi,

    Okay so at the moment i have my VPS and home PC setup to remote backup via ftp from vps to my pc.

    It all works however because my desktop is not designed to be a server (obviously) often FTP isnt running, or my router decides to reset itself and doesnt forward port 21 and i miss the backup because it misses the cron, and i end up haveing to chnage cron times to make it work... which is a big pain and i have ended up missing about 3 weeks of daily backups :(

    How can i either write, or re-write the cpbackup cron so that instead of just not doing much, it re-trys until it works, or at the least keeps trying to connect for X minutes and if still cant connect it emails me informing me of this.

    Thanks,
    Dan
     
  2. rrwh

    rrwh Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    You are going about this all wrong.

    If your PC is not on the wire all the time, then you might consider initiating the backup from a task on your PC.
     
  3. dansgalaxy

    dansgalaxy Well-Known Member

    Joined:
    Jan 29, 2007
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Reading, UK
    cPanel Access Level:
    Root Administrator
    I honestly didnt think of that...

    How could it be done though? How could i have my computer request that the backup cron be run?

    I know if it was a normal one i could just request the URL and it runs, but i havnt really played with server side crons etc.

    Also would there be a way to write a script/batch/program which runs on my pc which also checks if MY FTP is accessibly (from the outside by trying to connect using EXTERNALIP:21) before connecting to server and requesting backup?

    Thanks,
    Dan
     
  4. stdout

    stdout Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    189
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Nelspruit, Mpumalanga, South Africa
    cPanel Access Level:
    Root Administrator
    You're opening a whole new can of worms with windows/batch scripting.
    If you're using windows, look into the "at" command, "at /?" in command prompt.

    I think you're doing way too much for this though.
    Why not just schedule the backups to run during the day when you know you'll be online?

    Seeing as you're not copying to the local disk you won't experience disk i/o issues.
    The only impact would be CPU, but just "nice" cpbackup to 19 - "man nice".
     
  5. dansgalaxy

    dansgalaxy Well-Known Member

    Joined:
    Jan 29, 2007
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Reading, UK
    cPanel Access Level:
    Root Administrator
    I know how to schedule tasks in windows its more what to schedule lol.

    I am (trying) to backup to my local disk, and I did set the cron to run at a set time when i am virtually always online. But as i said because its a desktop having FTP running, ports open etc arnt always working, and its a pain in the backside as i have to then do everything manually and then reset the cron times to get it to run, which is why im looking for a way for my local pc to initlise the backup so i can check ftp is running fine run a script and it sets things going (or much much much more preferably i just have something which checks if my local FTP ports are open and running, if not re-try x times if that fails send me an email if it works run backup.)

    Any ideas....

    Dan
     
Loading...

Share This Page