You are not logged in.

#1 2008-03-28 21:18:12

colbert
Member
Registered: 2007-12-16
Posts: 809

Help to make script

I would like to run this command:

sudo rsync -avzp --progress --delete --exclude=/root --exclude=/var/tmp/kde* --exclude=/proc --exclude=/home --exclude=/media --exclude=/var/cache/pacman --exclude=/tmp/* --exclude=/lost+found --exclude=/var/backup --exclude=/mnt --exclude=/usr/man --exclude=/var/abs --exclude=/sys / /media/extra/backup/archbackup

But make a script so it asks me what the destination ("/media/extra/backup/archbackup" above) will be. Any help appreciated, thanks smile

Offline

#2 2008-03-28 21:21:47

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

Re: Help to make script

You could make a bash script called "backup" and call it using "backup <directory>" and use

sudo rsync -avzp --progress --delete --exclude=/root --exclude=/var/tmp/kde* --exclude=/proc --exclude=/home --exclude=/media --exclude=/var/cache/pacman --exclude=/tmp/* --exclude=/lost+found --exclude=/var/backup --exclude=/mnt --exclude=/usr/man --exclude=/var/abs --exclude=/sys / $1

Offline

#3 2008-03-28 21:34:35

Zepp
Member
From: Ontario, Canada
Registered: 2006-03-25
Posts: 334
Website

Re: Help to make script

Other option would be to just make a new alias for that command + options.

Offline

#4 2008-03-29 19:32:03

colbert
Member
Registered: 2007-12-16
Posts: 809

Re: Help to make script

Thank you, I added the alias to my .bashrc and now I can do:

archbackup /path/to/backup

and it works nice smile Thanks!!

Offline

Board footer

Powered by FluxBB