Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 11 of 11

This is a discussion on Backup for dummies in the Shared & Semi-Dedicated forum
I'm on a semi-dedicated server and I need some help with doing backups. Since I started my website I've just been keeping a local copy ...

  1. #1
    JPC Member
    Join Date
    Feb 2008
    Location
    Huangshan, China
    Posts
    45

    Backup for dummies

    I'm on a semi-dedicated server and I need some help with doing backups.

    Since I started my website I've just been keeping a local copy on my PC and then adding anything new to it every day via FTP, which isn't very efficient as there can be a lot of large images involved.

    I looked at the video tutorial on CPanel and generated a full backup to download, but that takes forever!

    I noticed in my root directory that I have the public_html folder that has the website in and there is also a 'www' folder which has a copy of my website in from when I moved to JPC....although sometimes there's more recent stuff in there too...not sure how that works!

    I think I must be missing something and there is an easy way for me to make a copy of my site and put it in the "www" folder myself directly on the server. How would I do that?

    Could I also set up a cronjob to do it automatically every day?

    Thanks in advance,
    Mark

  2. #2
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Quote Originally Posted by Mark_Amy View Post
    I noticed in my root directory that I have the public_html folder that has the website in and there is also a 'www' folder which has a copy of my website in from when I moved to JPC....although sometimes there's more recent stuff in there too...not sure how that works!
    'www' is just a symlink to 'public_html', so don't pay any attention to it, and DO NOT back it up!

    That 'www' symlink is used for some sort of chicanery, so don't delete it, but don't back it up either!

    It won't hurt anything to backup your site twice, but it's a waste of time and resources...

    LoL!

    Is this making ANY sense?

    Let's put it this way:

    'www' is like a shortcut for the OS...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  3. #3
    JPC Member
    Join Date
    Feb 2008
    Location
    Huangshan, China
    Posts
    45
    OK,I get the message, leave the "www" folder the hell alone

    So what's an easy way to backup then? And by easy I mean fast. Can I back up to the server, but outside of the public_html folder so hackers can't get at it?

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Well, I use CLI (via shell) which TARs everything up pretty fast, but it still takes forever to download it to my PC.

    There's no way to get around that, unless you're running a lightsword connection, or whatever...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  5. #5
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    I was looking at my BASH history, and this is what I ran last time...

    Code:
    tar -cvpjf Lenon.com_`date +%m-%d-%y`_Backup.tbz /home/<account> --exclude=/home/<account>/*.tbz --exclude=/home/<account>/.trash --exclude=/home/<account>/etc-bkp --exclude=/home/<account>/mail-bkp --exclude=/home/<account>/public_html_old --exclude=/home/<account>/g2data/cache --exclude=/home/<account>/public_html/e107/e107_files/cache --exclude=/home/<account>/public_html/info/wp-content/cache --exclude=/home/<account>/public_html/joomla/cache --exclude=/home/<account>/public_html/modules/ODP/cache --exclude=/home/<account>/public_html/pilot/modules/ODP/cache --exclude=/home/<account>/tmp/analog/cache --exclude=/home/<account>/tmp/webalizer/dns_cache.db --exclude=/home/<account>/www
    Of course, this is tailored for my install... but it should give you an idea.

    As you can probably tell, the whole 'secret' is to exclude a bunch of crap that doesn't make any difference, including the 'www' symlink...

    BTW, I run this outside my web path, so nobody can get at it but me...
    Last edited by Vin DSL; 03-16-2008 at 01:50 AM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  6. #6
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,775
    Oops!

    Forgot to mention...

    Make sure you backup your sql dbs too!

    Personally, I run my own install of phpMyAdmin and simply use it to backup my databases - then download them to my PC...

    I'm sure someone will hop in here and tell you how to do that from CLI also!
    Last edited by Vin DSL; 03-16-2008 at 01:51 AM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL © 2010

  7. #7
    JPC Member
    Join Date
    Feb 2008
    Location
    Huangshan, China
    Posts
    45
    Ok, you're losing me now....BASH??

    What do you mean by "outside my web path"?

    Creating a TAR of my site is pretty quick, but it's the download that really doesn't work for me at all.

    I wish you could just right-click the public_html folder and then "copy" to another folder where no one could get at it.

    *edit* yeah, I always do the sql dbs, they're no problem.
    Last edited by Mark_Amy; 03-16-2008 at 01:50 AM. Reason: added a bit

  8. #8
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,307
    JAG offers additional webspace for backup purposes.

    You can use WinSCP to keep a local (PC) directory sync'd with your website. After the pain of the initial sync, things run very nicely.

    It currently takes WinSCP about 5 minutes to scan my site and compare it to my PC's hard drive. I have about 13Gig in about 70,000 files in about 1,000 folders.

    I'm on a very fast connection so downloading the new / changed files only takes a couple of minutes.

    Don't forget to dump your database(s) to flat files so that they are included in your backups.
    Good luck

  9. #9
    JPC Member
    Join Date
    Feb 2008
    Location
    Huangshan, China
    Posts
    45
    Thanks Ron, I'll have a look at WinSCP.

    Wish I had your internet connection!!

    Just one question, "Don't forget to dump your database(s) to flat files so that they are included in your backups." That threw me, is this part of using WinSCP or a separate process? If it's a separate process, can you explain it a bit easier for me?

    Thanks!

  10. #10
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,307
    I put a script on my server that runs on the command line. I run the command to execute it when I log onto my site with WinSCP. Then when I run the sync, the flat files are picked up.

    The command file is very very basic. For each database user, there is one line in the file. So for 2 users:
    Code:
    time mysqldump -u cpanelname_dbusername -pPASSWORDHERE -a --all-databases |gzip -9 >dbusername-backup-$1.sql.gz
    time mysqldump -u cpanelname2_dbusername -pPASSWORD2HERE -a --all-databases |gzip -9 >dbusername2-backup-$1.sql.gz
    If that script filename is daily-db-backup.sh, the command to run this is
    Code:
    ./daily-db-backup.sh 20080316
    (the last bit is just today's date, and that becomes part of each dumpfilename.)
    This will create compressed flat files with the SQL statements required to re-create your databases in case something terrible were to happen.
    Good luck

  11. #11
    JPC Member
    Join Date
    Feb 2008
    Location
    Huangshan, China
    Posts
    45
    Thanks for the info on the script...I shall give that a try when I can really concentrate on what I'm doing...never done anything like that before!

    So anyway, I got the WinSCP all up and running and it's great! I was using FlashFXP before, which was highly recommended to me, but I'm finding WinSCP so much faster! I even worked out how to use SFTP instead of FTP and started using those private and public Putty keys for added security. Read a long thread earlier about a huge hack attack from last September, which kinda scared me a bit as it seemed to all stem from insecure FTP passwords so I thought I better do something about it.

    So thanks again and thanks to Vin DSL too....ever helpful as always

    Mark

Bookmarks

Posting Permissions

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