How to backup apache website

  • ray8902033
  • Novice
  • Novice
  • ray8902033
  • Posts: 29

Post 3+ Months Ago

I need to backup my apache website which is running on Linux on the same media that it is running on. What is the best way to perform this task.

Thank you in advance.

Ray
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2521
  • Loc: /usr/src/MI

Post 3+ Months Ago

You could create a shell script that runs every at XX:XX every day / week / whatever, and just have that remove the current contents of the backup folder and then copy everything over so there's a current backup. unless you want multiple backups?
just a thought..
  • ray8902033
  • Novice
  • Novice
  • ray8902033
  • Posts: 29

Post 3+ Months Ago

How do I do that.

Thank you in advance.


Ray
  • AnarchY SI
  • Web Master
  • Web Master
  • User avatar
  • Posts: 2521
  • Loc: /usr/src/MI

Post 3+ Months Ago

this should help

more
  • ray8902033
  • Novice
  • Novice
  • ray8902033
  • Posts: 29

Post 3+ Months Ago

Can I run a gzip command? How can I run a gzip command of folder.

Thank you

Ray
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

Do you just need the command to create the backup?
Code: [ Select ]
tar -czf /path/to/backup.tar.gz /path/to/wwwdir/html


If you want to do this on a routine, you can just add the following to your logrotate configuration (if you have logrotate installed, that is - look in /etc/cron.daily/)
Code: [ Select ]
/path/to/backup.tar.gz {
    daily
    rotate 14
    missingok
    compress
    postrotate
        tar -czf /path/to/backup.tar.gz /path/to/wwwdir/html
    endscript
}
  1. /path/to/backup.tar.gz {
  2.     daily
  3.     rotate 14
  4.     missingok
  5.     compress
  6.     postrotate
  7.         tar -czf /path/to/backup.tar.gz /path/to/wwwdir/html
  8.     endscript
  9. }
  • ray8902033
  • Novice
  • Novice
  • ray8902033
  • Posts: 29

Post 3+ Months Ago

Thank you so much for your help.


Ray

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 65 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.