You are not logged in.
Hello i want to have a script run after "pacman -Syu", is this possible and if not how can i set up this script to run completely autmatic with cron (it has parts where you usualy have to say Y or N and it has to run as root or use sudo and I want to have to do nothing)
heres the script:
#!/bin/bash
tar -cjf /.Backups/Pacman-Db_Backup/pacman-database.tar.bz2 /var/lib/pacman/local
pacman -Rscn $(pacman -Qtdq)
pacman -Sc
pacman-optimize && sync
updatedb
exit 0
Last edited by Oblivion7 (2015-09-09 19:54:07)
Anyone who has never made a mistake has never tried anything new. ~Albert Einstein
Offline
Jin, Jiyan, Azadî
Offline
You could just make an alias in your ~/.bashrc, for example...
alias upgrade='pacman -Syu && /path/to/script'
Now simply typing 'upgrade' will update your system and run the script.
Or how about just adding 'pacman -Syu' to the top of your script?
Offline
Or how about just adding 'pacman -Syu' to the top of your script?
I-I well uhhh, now i just feel stupid lol but i perfer the alias, thanks for the help guys!
Last edited by Oblivion7 (2015-09-09 20:07:48)
Anyone who has never made a mistake has never tried anything new. ~Albert Einstein
Offline
Please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309
Offline