You are not logged in.

#1 2015-09-09 19:49:40

Oblivion7
Member
From: Outside your universe.
Registered: 2015-08-29
Posts: 78

How to have my arch-clean.sh run automaticly after update

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

#2 2015-09-09 19:54:51

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: How to have my arch-clean.sh run automaticly after update

Offline

#3 2015-09-09 19:57:15

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: How to have my arch-clean.sh run automaticly after update

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?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2015-09-09 20:07:26

Oblivion7
Member
From: Outside your universe.
Registered: 2015-08-29
Posts: 78

Re: How to have my arch-clean.sh run automaticly after update

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

#5 2015-09-09 22:12:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to have my arch-clean.sh run automaticly after update

Please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309

Offline

Board footer

Powered by FluxBB