Dir cleanup.

This commit is contained in:
Andrew Schott 2024-07-02 04:07:29 -05:00
parent cf2edaa1e7
commit ab60ec957f
4 changed files with 0 additions and 0 deletions

42
gaming/cxg_backup.sh Executable file
View file

@ -0,0 +1,42 @@
#!/bin/bash
##
## Crossover Bottle Mass Backup Utility -- Bash edition.
##
## Written by Andrew Schott ( with help from bashscripts.org )
## Send any questions to andrew@schotty.com
##
## v1.1 -- Fixed paths for Crossover 11
## v1.0 -- Initial release.
##
## Set backup file directories.
CXOBACKUPDIR="$HOME/cxobackup/"
## Set default CX bottle directories.
CXODIR="$HOME/.cxoffice"
## Create backup directories if they do not exist.
[ -d "$CXOBACKUPDIR" ] || mkdir "$CXOBACKUPDIR"
## Perform backup of .cxoffice
for bottle in $CXODIR/*/
do
if [[ "$bottle" = "$CXODIR/desktopdata/" ]]
then echo Skipping $bottle as it is a CX directory/file
elif [[ "$bottle" = "$CXODIR/installers/" ]]
then echo Skipping $bottle as it is a CX directory/file
elif [[ "$bottle" = "$CXODIR/tie/" ]]
then echo Skipping $bottle as it is a CX directory/file
elif [[ "$bottle" = "$CXODIR/cxoffice.conf" ]]
then echo Skipping $bottle as it is a CX directory/file
elif [[ "$bottle" = "$CXODIR/usage.log" ]]
then echo Skipping $bottle as it is a CX directory/file
else {
echo Archiving $bottle
/opt/cxoffice/bin/cxbottle --bottle "$bottle" --tar "${bottle%/}.cxarchive"
mv "${bottle%/}.cxarchive" "$CXOBACKUPDIR"
echo Archival of $bottle completed and moved to $CXOBACKUPDIR
}
fi
done