simple automated backup of apache (your websites) - Printable Version +- Linux-Noob Forums (https://www.linux-noob.com/forums) +-- Forum: Linux Server Administration (https://www.linux-noob.com/forums/forum-8.html) +--- Forum: LAMP (https://www.linux-noob.com/forums/forum-83.html) +--- Thread: simple automated backup of apache (your websites) (/thread-2965.html) |
simple automated backup of apache (your websites) - anyweb - 2004-12-30 the lan ftp server is a windows box, its only a local ftp, no access from the outside (internet) so i was hoping to modify the above script to do the following: * after the backup file has been created, login to the ftp server, and check if there are any files present * if the number of files present is 2 or less then start uploading the current backup * if the number of files present is 3 or more, delete the oldest file, and start uploading the current backup that's all i want it to do help ! cheers anyweb simple automated backup of apache (your websites) - xDamox - 2004-12-31 Hi, I aint that good with shell script but heres a solution in perl :) you can run it via command prompt: Code: perl -e 'use Net::FTP; $Host = "10.0.0.14"; $username = "test"; $password = "test123"; $ftp = Net::FTP->new($Host, Debug => 0) || die "Could not connect to ftp $@"; $ftp->login($username, $password) || die "Could not login" .$ftp->message; $ftp->put("Test.log", "Test.log") || die "failed to upload" . ftp->message; $ftp->quit;' well thats all thats needed ;) simple automated backup of apache (your websites) - JerLasVegas - 2005-01-20 As an alternative you can always set up a ssh connection between the two computers using ssh-keygen and then use rsync -ave ssh! simple automated backup of apache (your websites) - anyweb - 2005-02-02 ok i'm still playing with this and now i want to backup the mysql database weekly also, the exact same way as i am doing with apache. the command to backup the database is executed from /usr/local/mysql/bin and it's Code: ./mysqldump -u USER -p DATA >> forums_export.sql i then have to input the root password so, how can i automate this ? any ideas :) cheers anyweb simple automated backup of apache (your websites) - KobrAs - 2005-02-02 you almost figure it out youreself :) after the -p etner the password Code: ./mysqldump -u USER -p password DATA >> forums_export.sql simple automated backup of apache (your websites) - anyweb - 2005-02-03 ok i've tried but its not working totally right have a look at my script now Code: #!/bin/sh checking /backup i now have as follows: Quote:ls -al /backuptotal 5433644there should only be TWO apache backups, and one forums backup. That part looks ok but the script is erroring out on me...\ the errors i get after the script is done are Quote:[root@www cron.weekly]# ./apache.cronls: ./backup: No such file or directory i've fixed the mysqldump error with cd /usr/local/mysql/bin && ./mysqldump...... but i don't get the other one ? simple automated backup of apache (your websites) - znx - 2005-08-25 Hey, stray . in the BACKUPDIR=/backup <-- Slight cleaning of the script (which I like btw :)) Code: #!/bin/sh simple automated backup of apache (your websites) - anyweb - 2006-01-03 thanks znx ! now onto my next issue, ive installed Gallery, and its working nicely, however by copying over the entire photos from 2005 to my personal website, the backup file is going to be close to 7GB in size, so what i want to do is to exclude the following path from the backup Code: /usr/local/apache/websites/.../family/gallery2/g2data/albums/2005 how do i EXCLUDE the above path and all files in it from the backup script i'm currently using ? thanks in advance ! the ... is simply representing some other folders removed for clarity simple automated backup of apache (your websites) - hijinks - 2006-01-03 --exclude dirName add that to the tar command simple automated backup of apache (your websites) - anyweb - 2006-01-03 thanks dude but something is seriously wrong here, i've changed the script and ran it to test it, before i ran it, approx 15gb free on the hdd (if not more) now its at Code: [root@www /]# df -h and the script isnt complete yet (started hours ago, 5 or six hours ago....) here's a copy of the script, please tell me what is causing it to nosedive my server Code: #!/bin/sh help ! cheers anyweb |