Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

UAPI fullbackup file name issue

Discussion in 'cPanel Developers' started by ale.ab, May 3, 2019.

  1. ale.ab

    ale.ab Member

    Joined:
    Jul 9, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,
    i need to create a fullbackup and upload to customer's sftp server (extra my system backup).

    i can upload correctly with this script

    /usr/bin/uapi --user=cpaneluser Backup fullbackup_to_scp_with_password host=remote.server.com port=22 username=remoteuser password=12345678 directory=/home/ale/YYYY-MM-DD--HH-mm-username.tar.gz email=mymail@email.com

    backup works correctly but filename on remote server is
    YYYY-MM-DD--HH-mm-username.tar.gz
    i would is
    2019-05-03--11-04-cpaneluser.tar.gz


    in documentation
    UAPI Functions - Backup::fullbackup_to_scp_with_password - Developer Documentation - cPanel Documentation
    seems i can use fileformat with YYYY ecc...


    where i wrong?

    thank you
     
  2. kdub

    kdub Member

    Joined:
    Apr 19, 2019
    Messages:
    24
    Likes Received:
    6
    Trophy Points:
    3
    Location:
    California
    cPanel Access Level:
    Root Administrator
    If I'm reading this correctly, your issue is that when you run this from command line the backup filename being set is using the literal 'username' and you would like it to substitute the literal with the actual username of the cpanel user that the backup belongs to, as in the cpanel account for which the backup is being made?

    How are you calling this? Could you not just simply type in the username you used for --user? like `YYYY-MM-DD--HH-mm-cpaneluser.tar.gz`

    Edit: the argument you provide for "directory" is the directory on the remote server that you want to store the backup archive in, not the backup archive filename. It probably shouldn't be a file. As far as I can tell the naming convention that cPanel uses for backup archives it creates is hard coded, meaning there is no setting that allows you to change it. If your goal is just to track the cpanel user that backups belong to, you could just do something like 'directory=/home/ale/cpaneluser' and leave the tar filenames as cpanel makes them.
     
    #2 kdub, May 3, 2019
    Last edited: May 3, 2019
  3. ale.ab

    ale.ab Member

    Joined:
    Jul 9, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    correct, the filename on remote server is YYYY... and not 2019....

    but i found a solution....

    i run command in ssh
    Code:
    /usr/bin/uapi --user=cpaneluser Backup fullbackup_to_scp_with_password host=remote.server.com port=22 username=remoteuser password=12345678 directory=/home/ale/$(date +%Y-%m-%d--%H.%M.%S)--cpaneluser.tar.gz email=mymail@email.com
    
    this create a fullbackup and upload on remote server i path
    /home/ale/
    and filename is (for example)
    2019-05-04--10.14.12--cpaneluser.tar.gz

    so for me issue is solved.

    thank you
     
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,161
    Likes Received:
    474
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Glad to see you were able to find a solution for the issue @ale.ab and thanks for letting us know!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice