Déplacemets des scripts en dossier
Perso: -Script de sauvegarde des paquets [Anciennement dossier TSP]
This commit is contained in:
commit
31a5155f78
1 changed files with 33 additions and 0 deletions
33
Perso/package_save.sh
Executable file
33
Perso/package_save.sh
Executable file
|
@ -0,0 +1,33 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
name=packages_state
|
||||||
|
else
|
||||||
|
name=$1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
pathName="$name""_$(date +'%Y-%m-%d @ %Hh%M')"
|
||||||
|
|
||||||
|
mkdir "$pathName"
|
||||||
|
cd "./$pathName"
|
||||||
|
mkdir "./preferences.d"
|
||||||
|
|
||||||
|
cp /etc/apt/sources.list .
|
||||||
|
cp /etc/apt/preferences.d/my_preferences ./preferences.d/
|
||||||
|
|
||||||
|
sudo dpkg --get-selections > "manual_package_save"
|
||||||
|
|
||||||
|
a=TEM.sh
|
||||||
|
|
||||||
|
echo "#! /bin/bash" > $a
|
||||||
|
echo "" >> $a
|
||||||
|
echo "cd .." >> $a
|
||||||
|
echo "rm -r \"$pathName\"" >> $a
|
||||||
|
|
||||||
|
chmod u+x "$a"
|
||||||
|
|
||||||
|
cd -
|
||||||
|
|
||||||
|
exit
|
||||||
|
|
Loading…
Add table
Reference in a new issue