Skip to content

Commit

Permalink
Make backup script more remote
Browse files Browse the repository at this point in the history
  • Loading branch information
janwerkhoven committed Nov 25, 2023
1 parent c60f75c commit 9a02d0a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 20 deletions.
52 changes: 34 additions & 18 deletions lib/tasks/translations.rake
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,7 @@ namespace :translations do
destroy_counter = 0

exact_locations_to_delete = [
'product.6',
'products.8',
'products.10',
'products.11',
'products.12',
'webinars.13',
'webinars.14',
'footer.1',
'footer.2',
'footer.3',
'footer.4',
'footer.5',
'footer.6',
'footer.7',
'footer.8',
'footer.9',
'footer.10',
'footer.11',
'footer.12',
Expand All @@ -78,7 +63,33 @@ namespace :translations do
'footer.16',
'footer.17',
'footer.18',
'footer.19'
'footer.19',
'footer.2',
'footer.3',
'footer.4',
'footer.5',
'footer.6',
'footer.7',
'footer.8',
'footer.9',
'header.38',
'header.39',
'product.6',
'products.10',
'products.10',
'products.11',
'products.12',
'products.13',
'products.2',
'products.3',
'products.5',
'products.6',
'products.7',
'products.8',
'products.9',
'seo.2',
'webinars.13',
'webinars.14'
]

exact_locations_to_delete.each do |location|
Expand All @@ -92,10 +103,15 @@ namespace :translations do
end

starting_with_locations_to_delete = [
'products.10',
'products.13',
'products.5',
'products.6',
'products.7',
'products.9',
'seo.5',
'seo.6',
'seo.7',
'product.6'
'seo.7'
]

# TODO: optimise with
Expand Down
4 changes: 2 additions & 2 deletions remote/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo "----------"

(
set -x
scp remote/backup-remote.sh $url:~/
scp -v remote/backup-remote.sh $url:~/
ssh $url "~/backup-remote.sh $timestamp; rm -f ~/backup-remote.sh"
)

Expand All @@ -24,7 +24,7 @@ echo "----------"

(
set -x
scp $url:/var/www/rails.api.interflux.com/db/backups/$timestamp.tar.gz ./db/backups
scp -v $url:/var/www/rails.api.interflux.com/db/backups/$timestamp.tar.gz ./db/backups
tar --extract --file db/backups/$timestamp.tar.gz
bin/rails db:data:load_dir dir=backups/$timestamp
rm db/backups/$timestamp.tar.gz
Expand Down

0 comments on commit 9a02d0a

Please sign in to comment.