Results 1 to 11 of 11
  1. #1

    How to create special backup

    Hello

    I have an big account which used for upload images

    so I don't need cpanel to create daily backup for it

    I remove it from list backup in WHM

    But I need to do the folowing

    every 10 Days

    copy the folder from /home/user/public_html

    to /backup

    only copy the folder

    I did it but after 10 days I get an error that the folder exist in

    /backup

    so how I can give deferent name automatically every time for this backup folder ???

    like

    backup1

    and after 10 days

    backup2

    without remove backup1

    Please help

    Thanks a lot

  2. #2
    ANY hELP ???

  3. #3
    write a custom script for the task!

  4. #4
    I know that I must write custom script

    But How I can create automaticaly new name for this backup file

    to prevent create new file over old files ???

  5. #5
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    465
    Write a shell script that will "tar -czf filename /home/user/public_html" where you've set a filename string and include the current date in the filename string - easiest way probably.

  6. #6
    Yes I do that

    But `date` parameter have a space in it like

    Sun Jun 5 15:07:50 AST 2005

    How I can let this appear as

    SunJun515:07:50AST2005

    without space ??

    or like give me only
    Jun5

    without the others words or spaces

    Can you help

  7. #7
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    465
    Use date formatting options. For dd:mm:yyyy use:

    Code:
    date +"%d%m%Y"

  8. #8
    Thanks a lot it is help
    but

    date +"%d%m%Y"
    05062005

    so How I can put out month as June not 6

    like to be 05June2005 rather than 05062005

    and Thanks a lot

  9. #9
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    465
    Code:
    date +"%d%b%Y"
    "man date" has all the options.

  10. #10
    Thanks for all

    But How I can create a folder with date

    like

    what I must put

    mkdir now date ???

    I try mkdir 'date +"%d%b%Y"'

    But it is not working

    can anyone help me please ??

  11. #11
    you shouldn't use a single quote --> '
    but the following --> `

    so:

    Code:
    mkdir `date +"%d%b%Y"`

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •