Compare commits

...

3 Commits

Author SHA1 Message Date
Luca Pellegrini 54ae465630 bash: Aggiorna "Environment variables"
File di configurazione di Bash: aggiorna le parti che impostano alcune
variabili d'ambiente ("Environment variables"), e applica alcune altre
piccole modifiche.
2023-04-06 14:29:02 +02:00
Luca Pellegrini 16432f7ca5 Aggiorna .gitignore 2023-03-27 15:32:56 +02:00
Luca Pellegrini 706bc6b97a rsync: Sposta script in altro repository dedicato
Sposta gli script presenti in `rsync/bin/` in un altro repository Git
dedicato (chiamato 'scripts'), in cui verranno gestiti insieme ad altri
script Bash che uso quotidianamente.
2023-03-27 09:35:22 +02:00
11 changed files with 54 additions and 205 deletions

8
.gitignore vendored
View File

@ -1,3 +1,11 @@
# Temporary files
prova**
test**
output**
*.log
*.old
# Temporary directories
temp/
old/

View File

@ -1,4 +1,4 @@
# shellcheck shell=sh
# shellcheck shell=bash
# ~/.bash_profile: executed by the command interpreter for login shells.
#
# see /usr/share/doc/bash/examples/startup-files for examples.
@ -12,13 +12,15 @@
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
#shellcheck disable=SC1091
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin, if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
# Environment variables
# set PATH so it includes '~/AppImage' directory, if it exists
if [ -d "$HOME/AppImage" ] ; then
PATH="$HOME/AppImage:$PATH"
fi
# set PATH so it includes user's private bin, if it exists
@ -26,12 +28,11 @@ if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# set PATH so it includes '~/AppImage' directory, if it exists
if [ -d "$HOME/AppImage" ] ; then
PATH="$HOME/AppImage:$PATH"
# set PATH so it includes user's private bin, if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# Environment variables
# XDG Base Directory specification
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"

View File

@ -18,12 +18,15 @@ shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
HISTFILESIZE=10000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Automatically prepend `cd` when entering just a path in the shell
#shopt -s autocd
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
@ -77,7 +80,7 @@ esac
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
@ -99,6 +102,7 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f "$HOME/.bash_aliases" ]; then
#shellcheck disable=SC1091
. "$HOME/.bash_aliases"
fi
@ -112,3 +116,20 @@ if ! shopt -oq posix; then
. /etc/bash_completion
fi
fi
# Environment variables
if [ -n "$DISPLAY" ]; then
export EDITOR=xed
elif [ -n "$WAYLAND_DISPLAY" ]; then
export EDITOR=xed
else
export EDITOR=nano
fi
if [ -n "$DISPLAY" ]; then
export BROWSER=firefox
elif [ -n "$WAYLAND_DISPLAY" ]; then
export BROWSER=firefox
else
export BROWSER=
fi

View File

@ -13,26 +13,27 @@
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
#shellcheck disable=SC1091
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# Environment variables
# set PATH so it includes '~/AppImage' directory, if it exists
if [ -d "$HOME/AppImage" ] ; then
PATH="$HOME/AppImage:$PATH"
fi
# Environment variables
# set PATH so it includes user's private bin, if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# set PATH so it includes user's private bin, if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# XDG Base Directory specification
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"

View File

@ -1,15 +0,0 @@
# Cartelle e file nella partizione Data, da escludere nei backup con rsync
.Trash-1000/
lost+found
.vscode-oss/
fedora/
imm-disco/
musica-altro/
Musica/Downloads/
Nextcloud/*
SCGP/Immagini/*
Programmazione/*/venv/
SteamLibrary/
temp/
VMs/

View File

@ -1,56 +0,0 @@
#!/bin/bash
MNT_POINT='/media/luca/Backup'
# Partizione "Data"
EXCLUDES=$HOME/bin/exclude-Data.txt
rsync -av --exclude-from=$EXCLUDES /Data/ $MNT_POINT/Data/
#rsync -av --mkpath /Data/imm-disco/ $MNT_POINT/imm-disco/
# Linux Mint 21
rsync -av --mkpath --delete $HOME/Scaricati/ $MNT_POINT/Linux_Mint/Scaricati/
rsync -av --mkpath --delete $HOME/Scrivania/ $MNT_POINT/Linux_Mint/Scrivania/
## Config files (Git repository)
rsync -av --mkpath --delete $HOME/config-files/ $MNT_POINT/Linux_Mint/config-files/
## file nascosti
#rsync -av --mkpath $HOME/.thunderbird/ $MNT_POINT/Linux_Mint/.thunderbird/
#rsync -av --mkpath $HOME/.gnupg/ $MNT_POINT/Linux_Mint/.gnupg/
# Fedora KDE
#rsync -av --mkpath --delete $HOME/Scaricati/ $MNT_POINT/Fedora/Scaricati/
#rsync -av --mkpath --delete $HOME/Scrivania/ $MNT_POINT/Fedora/Scrivania/
## Config files (Git repository)
#rsync -av --mkpath --delete $HOME/config-files/ $MNT_POINT/Fedora/config-files/
# home (generica)
rsync -av --mkpath $HOME/Pubblici/ $MNT_POINT/home/Pubblici/
rsync -av --mkpath $HOME/Modelli/ $MNT_POINT/home/Modelli/
## bin
rsync -av --mkpath $HOME/bin/ $MNT_POINT/home/bin/
rsync -av --mkpath $HOME/.local/bin/ $MNT_POINT/home/.local/bin/
## file nascosti
rsync -av --mkpath $HOME/.local/share/strawberry/ $MNT_POINT/home/.local/share/strawberry/
rsync -av --mkpath $HOME/.config/strawberry/ $MNT_POINT/home/.config/strawberry/
rsync -a --mkpath --delete $HOME/.local/share/TelegramDesktop/ $MNT_POINT/home/.local/share/TelegramDesktop/
## themes e icons
#rsync -av --mkpath --delete $HOME/.icons/ $MNT_POINT/home/.icons/
#rsync -av --mkpath --delete $HOME/.themes/ $MNT_POINT/home/.themes/
## altro
rsync -av --mkpath --delete $HOME/CD-audio/ $MNT_POINT/home/CD-audio/
## VSCodium extensions
#rsync -a --mkpath --delete $HOME/.vscode-oss/extensions/ $MNT_POINT/home/.vscode-oss/extensions/
## SSH keys
#rsync -av --mkpath $HOME/.ssh/ $MNT_POINT/home/.ssh/
# Argomenti di rsync
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -1,56 +0,0 @@
#!/bin/bash
MNT_POINT='/media/luca/Backup'
# Partizione "Data"
EXCLUDES=$HOME/bin/exclude-Data.txt
rsync -av -n --exclude-from=$EXCLUDES /Data/ $MNT_POINT/Data/
#rsync -av --mkpath -n /Data/imm-disco/ $MNT_POINT/imm-disco/
# Linux Mint 21
rsync -av --mkpath -n --delete $HOME/Scaricati/ $MNT_POINT/Linux_Mint/Scaricati/
rsync -av --mkpath -n --delete $HOME/Scrivania/ $MNT_POINT/Linux_Mint/Scrivania/
## Config files (Git repository)
rsync -av --mkpath -n --delete $HOME/config-files/ $MNT_POINT/Linux_Mint/config-files/
## file nascosti
#rsync -av --mkpath -n $HOME/.thunderbird/ $MNT_POINT/Linux_Mint/.thunderbird/
#rsync -av --mkpath -n $HOME/.gnupg/ $MNT_POINT/Linux_Mint/.gnupg/
# Fedora KDE
#rsync -av --mkpath -n --delete $HOME/Scaricati/ $MNT_POINT/Fedora/Scaricati/
#rsync -av --mkpath -n --delete $HOME/Scrivania/ $MNT_POINT/Fedora/Scrivania/
## Config files (Git repository)
#rsync -av --mkpath -n --delete $HOME/config-files/ $MNT_POINT/Fedora/config-files/
# home (generica)
rsync -av --mkpath -n $HOME/Pubblici/ $MNT_POINT/home/Pubblici/
rsync -av --mkpath -n $HOME/Modelli/ $MNT_POINT/home/Modelli/
## bin
rsync -av --mkpath -n $HOME/bin/ $MNT_POINT/home/bin/
rsync -av --mkpath -n $HOME/.local/bin/ $MNT_POINT/home/.local/bin/
## file nascosti
rsync -av --mkpath -n $HOME/.local/share/strawberry/ $MNT_POINT/home/.local/share/strawberry/
rsync -av --mkpath -n $HOME/.config/strawberry/ $MNT_POINT/home/.config/strawberry/
rsync -a --mkpath -n --delete $HOME/.local/share/TelegramDesktop/ $MNT_POINT/home/.local/share/TelegramDesktop/
## themes e icons
#rsync -av --mkpath -n --delete $HOME/.icons/ $MNT_POINT/home/.icons/
#rsync -av --mkpath -n --delete $HOME/.themes/ $MNT_POINT/home/.themes/
## altro
rsync -av --mkpath -n --delete $HOME/CD-audio/ $MNT_POINT/home/CD-audio/
## VSCodium extensions
#rsync -a --mkpath -n --delete $HOME/.vscode-oss/extensions/ $MNT_POINT/home/.vscode-oss/extensions/
## SSH keys
#rsync -av --mkpath -n $HOME/.ssh/ $MNT_POINT/home/.ssh/
# Argomenti di rsync
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -1,18 +0,0 @@
#!/bin/bash
MNT_POINT='/media/luca/HDD-1'
rsync -av -n --mkpath /Data/temp/ $MNT_POINT/temp/
# Audio e Video
MULTIMEDIA=$MNT_POINT/Multimedia
rsync -av -n --mkpath /Data/Immagini/ $MULTIMEDIA/Immagini/
rsync -av -n --mkpath --delete /Data/Musica/ $MULTIMEDIA/Musica/
rsync -av -n --mkpath /home/luca/CD-audio/ $MULTIMEDIA/musica-altro/CD-audio/
rsync -av -n --mkpath /Data/Podcast/ $MULTIMEDIA/Podcast/
rsync -av -n --mkpath /Data/Video/ $MULTIMEDIA/Video/
# Documenti e altro
DOCS=$MNT_POINT/Documenti_e_altro
rsync -av -n --mkpath /Data/Libri/ $DOCS/Libri/

View File

@ -1,18 +0,0 @@
#!/bin/bash
MNT_POINT='/media/luca/HDD-1'
rsync -av --mkpath /Data/temp/ $MNT_POINT/temp/
# Audio e Video
MULTIMEDIA=$MNT_POINT/Multimedia
rsync -av --mkpath /Data/Immagini/ $MULTIMEDIA/Immagini/
rsync -av --mkpath --delete /Data/Musica/ $MULTIMEDIA/Musica/
rsync -av --mkpath /home/luca/CD-audio/ $MULTIMEDIA/musica-altro/CD-audio/
rsync -av --mkpath /Data/Podcast/ $MULTIMEDIA/Podcast/
rsync -av --mkpath /Data/Video/ $MULTIMEDIA/Video/
# Documenti e altro
DOCS=$MNT_POINT/Documenti_e_altro
rsync -av --mkpath /Data/Libri/ $DOCS/Libri/

View File

@ -1,16 +0,0 @@
#!/bin/bash
MNT_POINT='/media/luca/LUCA-32GB'
rsync -av -n --delete --exclude "Downloads" /Data/Musica/ $MNT_POINT/Musica/
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -1,3 +0,0 @@
#!/bin/bash
rsync -av --delete --exclude "Downloads" /Data/Musica/ /run/media/luca/SD-CARD/Musica/