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.

Change Remote Backup Folder Names...

Discussion in 'Data Protection' started by PCZero, Feb 3, 2015.

  1. PCZero

    PCZero Well-Known Member

    Joined:
    Dec 13, 2003
    Messages:
    526
    Likes Received:
    34
    Trophy Points:
    28
    Location:
    Earth
    I have submitted a feature request at - Removed - for this, but I wanted to know if there is a way can make a modification on my own to do this now...

    What I want to do is change the naming convention of the remote FTP back up folders slightly. In the current remote FTP back up process the back up files for the daily back ups are stored at the remote location root, but the weekly and monthly are stored, respectively, in the weekly and monthly folders/sub-directories. I want to store the daily back ups in a daily folder/sub-directory for uniformity and clarity. The way the back ups are stored now, the daily runs are stored with no indication of what level back up they are whereas the weekly and monthly are clearly described. If anyone knows where I can make the change to do this please help me out.

    Thanks!
     
    #1 PCZero, Feb 3, 2015
    Last edited by a moderator: Feb 5, 2015
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You could create a custom script that connects to the remote FTP server, creates the additional directory, and moves the backup archives into that directory. Then, you could setup an event hook that runs that script automatically after backups complete. EX:

    Code:
    /usr/local/cpanel/bin/manage_hooks add script /root/post_backup --category System --event Backup --stage post
    Documentation: Hookable Events

    Thank you.
     
  3. PCZero

    PCZero Well-Known Member

    Joined:
    Dec 13, 2003
    Messages:
    526
    Likes Received:
    34
    Trophy Points:
    28
    Location:
    Earth
    I actually thought about this. The issue is that (from the observations I have made), cPanel considers the back up complete once the packages have been created and not after the remote transfer have finished. While that may not be the actual case, I deduced this from the fact that this is the point where the 'backup complete' email is generated and sent. Therefore, in order to do as you suggest I would need to have a way to know when the actual remote transfer is done.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You could configure your custom script to only run after a set time period or after a specific file or directory exists on the remote server.

    Thank you.
     
  5. PCZero

    PCZero Well-Known Member

    Joined:
    Dec 13, 2003
    Messages:
    526
    Likes Received:
    34
    Trophy Points:
    28
    Location:
    Earth
    Thanks Michael. I am really hoping that whoever it is that has final say over changes will approve this one so it will all be done with not scripting required. I realize this is a rather low priority issue however I am thinking that maybe it could be as simple as cloning the code segment that create the 'weekly' and/or monthly directory structure and mod it slightly to have the same functionality for daily back ups.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  7. PCZero

    PCZero Well-Known Member

    Joined:
    Dec 13, 2003
    Messages:
    526
    Likes Received:
    34
    Trophy Points:
    28
    Location:
    Earth
Loading...

Share This Page