Create Repositories with the *.dump filetype


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Create Repositories with the *.dump filetype
# 1  
Old 08-30-2010
Create Repositories with the *.dump filetype

I've a bunch of repository dumps that I need to include in my shell script to restore from the dump, but first I need to create the repositories first. How do I extract the names of the repository and removing the *.dump for use of the following line?

Code:
bash-3.00$ ls
andromeda.dump
alias.dump
broken.dump
calibre.dump
...

and I need to execute this commands

Code:
bash-3.00$ svnadmin create andromeda
bash-3.00$ svnadmin load andromeda </opt/vendor/svn/backups/andromeda.dump &

and repeat this for a few hundred repositories.

My guess is I need to use sed or awk to transform and omit the ".dump" first?
# 2  
Old 08-30-2010
Not tested:
Code:
for dump in *.dump
do
    repo=$( basename $dump '.dump' )
    echo svnadmin create $repo
    ( echo "svnadmin load $repo < /opt/vendor/svn/backups/$dump" && echo "$(date) $repo restore done" ) &
done

If the commands echoed look ok, un-echo the svnadmin commands.

Last edited by pludi; 08-31-2010 at 04:10 AM.. Reason: fixed
This User Gave Thanks to pludi For This Post:
# 3  
Old 08-31-2010
Quote:
Originally Posted by pludi
Not tested:
Code:
for dump in *.dump
do
    repo=$( basename $dump )
    echo svnadmin create $repo
    ( echo "svnadmin load $repo < /opt/vendor/svn/backups/$dump" && echo "$(date) $repo restore done" ) &
done

If the commands echoed look ok, un-echo the svnadmin commands.
I tested the script and it doesn't omit off the *.dump.
# 4  
Old 08-31-2010
Ah, yes, missed something on the basename line. Fixed in the above post.
This User Gave Thanks to pludi For This Post:
# 5  
Old 08-31-2010
Perfect! Exactly what I needed! Thanks! :-)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Loading Animation for Large Man Page Repositories

Should have done this 10 years ago, so better late than never: Just added a "loading" animation to the the man page repositories when they load, especially since some are very large and take many seconds to load. See for example: https://www.unix.com/man-page-opensolaris-repository.php ... (1 Reply)
Discussion started by: Neo
1 Replies

2. What is on Your Mind?

Man Page Repositories - Added jQuery and Bootstrap

I added both jQuery and Bootstrap Javacript libs to all man page repository pages. TODO: I need to add pagination to these repos because most are very large and load to slow on a single page. For the first upgrade, I manually added one new CSS Class (repository) to the main repo tables and... (0 Replies)
Discussion started by: Neo
0 Replies

3. Shell Programming and Scripting

Moving multiple filetype in a single loop

Hi, I am using the below code to move *.sh files to another directory. use File::Copy qw(move); while(<C:/Users/pandeesh/Desktop/*.sh>) { move $_,"C:/Users/pandeesh/Desktop/Projects"; } My requirement is i want to move *.sh,*.txt,*.xlsx,*.doc,*.pdf and *.epub files to the specified... (2 Replies)
Discussion started by: pandeesh
2 Replies

4. Shell Programming and Scripting

Converting DOS filetype to UNIX

Hello folks I am working on a project that requires me to write a script that operates on a bunch of text files. When I try less file.txt I see a bunch of ^M's everywhere. Some Googling tells me that this is because the files have a DOS fileformat and found the following fixes: sed 's/^M$//'... (5 Replies)
Discussion started by: ksk
5 Replies

5. Debian

Repositories in sources.list

I'm just interested to know how your sources.list look like. I got some repositories witch give some errors and I would like to clean it up. and when I do apt-get update I get few lines showing errors like 404 , this is how my list look like: # deb cdrom:/ squeeze main # deb cdrom:/... (0 Replies)
Discussion started by: zdorian
0 Replies

6. Homework & Coursework Questions

Grep for filetype starting with letter p

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Which files in /usr/bin whose names begin with “p” are python scripts? Store the numbered results in... (3 Replies)
Discussion started by: alindner
3 Replies

7. UNIX for Dummies Questions & Answers

Where are the repositories located in SUSE SLES 10 SP2

Hi, In SUSE SLES 10 SP2 where are the software repositories located? In CENTOS they are in /etc/yum.repositories or something like that. What does SLES use? (1 Reply)
Discussion started by: mojoman
1 Replies

8. Ubuntu

Universal Repositories for All Linux Distros

Is it possible to use Other Distro's ( i.e Debian's or Ubuntu's ) repositories in Fedora? If not then what should be done to make common repositories for all linux distros. regards, Arun Maurya (2 Replies)
Discussion started by: arun_maurya
2 Replies

9. Linux

mount filetype error

Hello, I am trying to mount an external USB drive connected to a SnapServer 410 ( a network file server running a linux OS called Guardian OS). THanks to some articles on the the web, I found that I needed to use the following command: > mount -t vfat /dev/sde /mnt/usbext ... (7 Replies)
Discussion started by: drmoque
7 Replies

10. UNIX for Dummies Questions & Answers

help, what is the difference between core dump and panic dump?

help, what is the difference between core dump and panic dump? (1 Reply)
Discussion started by: aileen
1 Replies
Login or Register to Ask a Question