LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-06-2011, 06:21 AM   #1
fabbychips
LQ Newbie
 
Registered: Jul 2011
Posts: 6

Rep: Reputation: Disabled
Talking how to make a scheduled backup of repository ,and how to recover it?


i need to make a scheduled backup of repository of subversion in ubuntu.
eg,backup the repository at 13.00 pm every Monday
may i need to write some hook scripts to do that?
and i also have to recover the backup of repository
if possible,i want to backup the trunk of repository
my repository is project1
/project1
/trunk
/tags
/branches
any one can give some suggestion?
 
Old 08-06-2011, 07:33 AM   #2
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Rep: Reputation: 8
You can use crontab to schedule tasks in Linux.

Type the following command:
Code:
sudo crontab -e
At the "command" section you can then write the backup command,
for example
Code:
sudo tar -cvf backup.tar project1/trunk
 
1 members found this post helpful.
Old 08-06-2011, 07:35 AM   #3
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Rep: Reputation: 8
Here's a good manual about using crontab.
Code:
http://adminschoice.com/crontab-quick-reference
 
1 members found this post helpful.
Old 08-06-2011, 10:42 AM   #4
fabbychips
LQ Newbie
 
Registered: Jul 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Talking

Quote:
Originally Posted by Annielover View Post
You can use crontab to schedule tasks in Linux.

Type the following command:
Code:
sudo crontab -e
At the "command" section you can then write the backup command,
for example
Code:
sudo tar -cvf backup.tar project1/trunk
i've typed
Code:
sudo crontab -e
and
Code:
30 23 * * * tar -cvf /home/clx/backup.tar /home/clx/project1
then i type "Ctrl + O" write out ,then exit
i says "crontab:installing new crontab"

but after 23:30 ,i don't see backup.tar in /home/clx
what's wrong ?
i need your help
 
Old 08-06-2011, 11:01 AM   #5
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Rep: Reputation: 8
You have to restart the cron deamon.
Try
Code:
sudo /etc/init.d/cron restart
OR
Code:
sudo service cron restart
 
Old 08-07-2011, 04:42 AM   #6
fabbychips
LQ Newbie
 
Registered: Jul 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by Annielover View Post
You have to restart the cron deamon.
Try
Code:
sudo /etc/init.d/cron restart
OR
Code:
sudo service cron restart
i've solved it
1 make a script file : backup.sh #(make sure this file has the execute permission)
#! /bin/sh
BDATE=`date +%Y%m%d`
sudo svnadmin dump /home/clx/project1 > /home/clx/backup$BDATE.dump
echo success!

2 in /etc/crontab
0 24 * * * root sudo /home/clx/backup.sh

3 then the backup file backup20110807.dump will be in /home/clx/

4 and recover that backup file :
~$svnadmin create newproject1;svnadmin load newproject1 < backup20110807.dump

but now i want to backup the trunk of my repository.only the trunk,not the whole repository
and the most important ,how to recover the trunk
 
Old 08-07-2011, 07:49 AM   #7
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Rep: Reputation: 8
make back-up of trunk only:
Code:
sudo tar -cf $HOME/project/trunk
To recover:
Code:
tar -xpf $HOME/FileName.tar
$HOME is a path variable and contains de homedir of the user logged in.
i.e.: /home/annielover
 
  


Reply

Tags
recover, schedule, subversion



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Scheduled backup question stealth13 Linux - Newbie 5 02-24-2011 03:59 AM
making scheduled backup image digity Linux - Newbie 5 03-28-2009 09:49 PM
scheduled backup - WinXP to Linux samengr Linux - General 4 01-23-2008 07:17 AM
How to make a scheduled backup using cron file? mus1402 Linux - Newbie 3 02-04-2006 11:23 PM
How to make a scheduled backup procedure using the cron file? mus1402 Linux - Networking 1 02-04-2006 10:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration