Backup : Update paths.
This commit is contained in:
parent
3a9007dcac
commit
bbbc2cb3ba
|
@ -29,16 +29,12 @@ if [ ! -f "${path_src}"/.mount ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Tweak bash.
|
|
||||||
shopt -s globstar
|
|
||||||
shopt -s dotglob
|
|
||||||
|
|
||||||
# Cd to src storage.
|
# Cd to src storage.
|
||||||
cd "${path_src}"
|
cd "${path_src}"
|
||||||
|
|
||||||
# Save media list.
|
# Save media list.
|
||||||
find ${path_media} -type d > ${path_backup}/media/cold/ColdMedia.txt || report "Backup : Failed to save media list!"
|
find ${path_media} -type d > ${path_backup}/cold/ColdMedia.txt || report "Backup : Failed to save media list!"
|
||||||
cd ${path_backup}/media/cold/
|
cd ${path_backup}/cold/
|
||||||
archive_fast ColdMedia.txt && rm ColdMedia.txt || report "Backup : Failed to archive media list!"
|
archive_fast ColdMedia.txt && rm ColdMedia.txt || report "Backup : Failed to archive media list!"
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
|
@ -47,24 +43,28 @@ docker=$(archive_fast docker/)
|
||||||
bupsize=$(du ${docker} | awk '{print $1}')
|
bupsize=$(du ${docker} | awk '{print $1}')
|
||||||
mv ${docker} ${path_docker}/ || report "Backup : Failed to save docker!"
|
mv ${docker} ${path_docker}/ || report "Backup : Failed to save docker!"
|
||||||
|
|
||||||
|
# Backup some media.
|
||||||
|
cd ${path_src}/media/
|
||||||
|
paper=$(archive_fast paper/)
|
||||||
|
mv ${paper} ${path_backup}/paper/ || report "Backup : Failed to save paper!"
|
||||||
|
cd -
|
||||||
|
|
||||||
|
# Prune media copies.
|
||||||
|
cd ${path_backup}/paper/
|
||||||
|
archive_prune
|
||||||
|
cd -
|
||||||
|
|
||||||
|
cd ${path_backup}/cold/
|
||||||
|
archive_prune
|
||||||
|
cd -
|
||||||
|
|
||||||
# Prune old Docker copies.
|
# Prune old Docker copies.
|
||||||
cd ${path_docker}
|
cd ${path_docker}
|
||||||
archive_prune Docker 7
|
archive_prune Docker 7
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
# Prune game saves.
|
# Prune game saves.
|
||||||
cd "${path_backup}/media/save/"
|
cd "${path_backup}/save/"
|
||||||
archive_prune Save 1
|
|
||||||
cd -
|
|
||||||
|
|
||||||
# Backup some media.
|
|
||||||
cd ${path_src}/media/
|
|
||||||
paper=$(archive_fast paper/)
|
|
||||||
mv ${paper} ${path_backup}/media/ || report "Backup : Failed to save paper!"
|
|
||||||
cd -
|
|
||||||
|
|
||||||
# Prune media copies.
|
|
||||||
cd ${path_backup}/media/
|
|
||||||
archive_prune
|
archive_prune
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
|
|
Reference in a new issue