Compare commits

...

9 Commits

6 changed files with 48 additions and 3 deletions

View File

@@ -12,12 +12,16 @@ if [[ -z "$HOSTNAME" ]]; then
fi
EXTRA="$1"
TAG="System"
DATE="`date "+%Y%m%d-%H%M%S"`"
BACKUP_DIR="/srv/backup"
BASENAME="Backup"
TAG="System"
BACKUP="$BACKUP_DIR/$BASENAME.$DATE.$HOSTNAME.$TAG.zip"
TAG2="Data"
BACKUP2="${BACKUP//$TAG/$TAG2}"
## Initialization ##
echo "*** Creating Backup Directory ***"
@@ -31,15 +35,19 @@ sudo chown -Rv root:root "$BACKUP_DIR"
echo "*** Removing Old Backups ***"
cd "$BACKUP_DIR"
sudo mv -v "$BASENAME"*"$TAG"* TRASH/
sudo mv -v "$BASENAME"*"$TAG2"* TRASH/
sudo rm -v TRASH/*
## Main
# System Backup
echo "*** Creating backup at '$BACKUP' ***"
sudo zip -rv "$BACKUP" \
/etc /var/{log,mail,spool} /srv /boot \
/usr/local/etc $EXTRA \
-x "/srv/backup/*" -x "/srv/sftp/*"
-x "/srv/backup/*" -x "/srv/sftp/*" \
-x "*/.gradle/" -x "*/app/build/*"
status="$?"
if [[ "$status" != 0 ]]; then
@@ -54,4 +62,27 @@ else
exit 1
fi
echo -e "\n\n"
sleep 5
# Data Backup
echo "*** Creating backup at '$BACKUP2' ***"
sudo zip -rv "$BACKUP2" \
/root /home /srv/sftp \
-x "*/.gradle/" -x "*/app/build/*"
status="$?"
if [[ "$status" != 0 ]]; then
echo "*** ERROR: Failed to create '$BACKUP2', file may be incorrect. ***"
fi
if [[ -e "$BACKUP2" ]]; then
ls -alh "$BACKUP2"
echo "*** '$BACKUP2' created successfully! ***"
else
echo "*** '$BACKUP2' not found! ***"
exit 1
fi
exit 0

View File

@@ -32,7 +32,7 @@ function usage {
-g : Enable the General config with test contents.
-w : Enable the Workstation config with test contents.
-s : Enable the Server config with test contents.
-f : Display this system's facts.
-f : Display this system's facts.
-h : Display this help text.
EOF
@@ -130,6 +130,7 @@ echo "Installed!"
if [[ "$show_facts" == "Y" ]]; then
echo "Showing Ansible Facts"
ansible localhost -m setup --connection=local
exit 0
fi
#echo "Adding Ansible Collections..."

View File

@@ -144,6 +144,11 @@
prod_port: "{{ lookup('ini', 'prod_port file={{gen_file}} default=22') }}"
prod_user: "{{ lookup('ini', 'prod_user file={{gen_file}} default=user') }}"
- name: General | Account Management | Provisioning Configuration | General | Boolean Check | Swap Block
set_fact:
swap_block: "{{ swap_block | bool }}"
when: swap_block in ("true", "false")
- name: General | Account Management | Provisioning Configuration | General | List
set_fact:
provision_variables: "{{ provision_variables | combine(item) }}"
@@ -223,6 +228,11 @@
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}"
redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) | bool }}"
- name: General | Account Management | Provisioning Configuration | Workstation | Boolean Check | Editing
set_fact:
editing: "{{ editing | bool }}"
when: editing in ("true", "false")
- name: General | Account Management | Provisioning Configuration | Workstation | List
set_fact:
provision_variables: "{{ provision_variables | combine(item) }}"

View File

@@ -1272,6 +1272,7 @@
- name: General | Account Management | Users | Files | Helper Functions (Reset)
shell: "rm -v {{ global_bin }}/*.function"
ignore_errors: yes
- name: General | Account Management | Users | Files | Helper Functions
copy:

View File

@@ -44,6 +44,7 @@
- { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" }
- { app: "app.grayjay.Grayjay", name: "grayjay", extra: "" }
- { app: "com.github.xournalpp.xournalpp", name: "xournal", extra: "" }
- { app: "network.loki.Session", name: "session", extra: "" }
flatpaks_coding:
- { app: "com.vscodium.codium", name: "codium-flatpak", extra: "" }
- { app: "com.google.AndroidStudio", name: "android-studio", extra: "" }

View File

@@ -21,6 +21,7 @@
, 'com.valvesoftware.Steam.desktop'
, 'net.lutris.Lutris.desktop'
, 'mullvad-vpn.desktop'
, 'network.loki.Session.desktop'
, 'org.signal.Signal.desktop', 'signal-desktop.desktop'
, 'org.telegram.desktop.desktop'
, 'com.discordapp.Discord.desktop'