You are not logged in.

#1 2009-03-28 07:53:23

hakws
Member
Registered: 2009-03-28
Posts: 2

Any code master help me on getting this script please *

Hi guys,

i am very new and have very less coding knowledge.

is thier any such script which i can use to make any folder on server tar.gz or tar and put them on any other location on server or better if it can upload it on other ftp server, and finaly i can cron it to take backup of file automatically

here is exactly what i want on easy note:

i use forum which use flat file system
i have to take backup everyday
thier are 3 folders which i need to take backup
i want a script which i can crone so that it will automatically compress it to tar.gz or tar file
and then it will store it on some place on current server or else best if it can upload this file to other ftp server.


please can anyone help me on this Huh

or guide me with links were i can find it

thanks

Offline

#2 2009-03-28 08:15:52

XFire
Member
From: UK
Registered: 2008-05-11
Posts: 192

Re: Any code master help me on getting this script please *

#!/bin/bash
# Released under GPL3

FOLDER="/YOURFOLDERNAME"
NEWLOCATION="/YOURFOLDERNAME"
TODAY=`date +%y%m%d`

    cd $TARGET

    tar -cf backup_$TODAY.tar ./FOLDERONE/
    bzip2 FOLDERONE_backup_$TODAY.tar

    tar -cf backup_$TODAY.tar ./FOLDERTWO/
    bzip2 FOLDERTWO_backup$TODAY.tar

    tar -cf backup_$TODAY.tar ./FOLDERTHREE/
    bzip2 FOLDERTHREE_backup$TODAY.tar

    mv ./FOLDERONE_backup_$TODAY.tar.gz ./FOLDERTWO_backup_$TODAY.tar.gz ./FOLDERTHREE_backup_$TODAY.tar.gz $NEWLOCATION

Just change the variable names, so folder and newlocation along with the folder names and then you are sorted

Last edited by XFire (2009-03-28 08:16:38)


There is a difference between bleeding [edge] and haemorrhaging. - Allan

Offline

#3 2009-03-28 08:17:01

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,392
Website

Re: Any code master help me on getting this script please *

hakws wrote:

or guide me with links were i can find it

Try www.google.com

We would be much more helpful if you made an attempt to get this started yourself.  And all capitals in the topic is annoying...

Offline

#4 2009-03-28 08:30:11

hakws
Member
Registered: 2009-03-28
Posts: 2

Re: Any code master help me on getting this script please *

#XFire

thank so much for ur smart response

just few more help , were should i save this scrip and with what name ?
and before croning how can i check it by executing ?
i have access to domain root like mydomain.com

and from ur given script i did understand this so let me know am i correct or not.

YOURFOLDERNAME will be full path of folder i want to keep backup files right ? like public_html/backups

FOLDERONE will be full path to folder which i want to compress public_html/forum/directory3

and so on ...

please reply


#Allan
thank for ur reply as well , hope u would have got some direct help from XFire as well

Offline

#5 2009-03-28 10:34:58

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Any code master help me on getting this script please *

hakws - two things: firstly, please change the topic to lower case where appropriate, as already suggested.

Secondly, I know you're new here, so I would recommend that you take the time to read about Arch Forum Etiquette, to look over the stickies in Newbie Corner, and to browse the wiki - these resources will give you a better understanding of Arch, how it works, and what is expected of Arch users.

Regarding this particular thread, you will see that it is customary for users to put some effort into resolving their own issues first, before asking for help in the forum. You have been fortunate enough to get a detailed response from XFire, so I would suggest you use that as the starting point for your own continuing research. Alternatively, you could just google for something like "website backup script".

XFire - you are, of course, free to continue helping if you want, but you might also want to keep my advice to hakws in mind.

Offline

#6 2009-03-28 10:38:42

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Any code master help me on getting this script please *

hakws: We won't write, configure and install the script for you.

XFire has been kind enough to give you something to start with. All of your questions are _really_ easy to find in documentation, google, wiki, and dozens of places. You just need to look, try and eventually understand what you're doing.

Last edited by iphitus (2009-03-28 10:39:25)

Offline

#7 2009-04-27 14:04:27

japetto
Member
From: Chicago, IL US
Registered: 2006-07-02
Posts: 183

Re: Any code master help me on getting this script please *

Offline

Board footer

Powered by FluxBB