123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #!/usr/bin/zsh
- #echo "Username?"
- #read username
- #echo "Server?"
- #read server
- #echo "Foreign path?"
- #read fpath
- #echo "Syncing Files"
- #rsync -rlpE --progress --delete ~ ${username}@${server}:${foreignpath}
- echo "Copying rpm install db, this may take time!"
- rpm -qa --qf "%{NAME}\n" >rpmdb.txt
- echo "Copying crontab."
- crontab -l >crontab.txt
- echo "Moving repos.d."
- mkdir repos.d
- sudo cp -r /etc/yum.repos.d repos.d
- echo "Creating movein.sh"
- cat <<EOF >movein.sh
- #!/usr/bin/bash
- echo "Reconstituting Crontab"
- cat crontab.txt | crontab
- echo "Reconstituting yum repos"
- sudo cp -r repos.d /etc/yum.repos.d
- echo "Reconstituting software"
- software = `cat rpmdb.txt`
- for \$pack in "\${software[@]}"
- do
- yum install \$pack
- done
- #echo "Syncing Files"
- #rsync -rlpE --delete ~ ${username}@${server}:${foreignpath}
- EOF
- chmod 0777 movein.sh
|