Skip to content

Commit

Permalink
Add backup script
Browse files Browse the repository at this point in the history
  • Loading branch information
ZNielsen committed Aug 11, 2022
1 parent c231419 commit 0f5892e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service_files/how_to.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- Symlink service file to `/etc/systemd/system/podracer.service`
- Create `/etc/podracer/config`
- Create `/etc/podracer/config` and change ownership
- Symlink rocket config to `/etc/podracer/config/Rocket.toml`
- Symlink binary to `/usr/local/bin/podracer`
- Symlink web stuff to `/etc/podracer/config/server/web`
20 changes: 20 additions & 0 deletions service_files/podcast_backup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

if [[ "$#" -lt "2" ]]; then
echo "Error: need destination and port"
exit 1
fi

dest="$1"
port="$2"

podcast_dir="/etc/podracer/podcasts"

# Zip up podcast dir
tmp_dir="$(mktemp -d)"
bak="$tmp_dir/podcast.bak.zip"
zip -r "$bak" "$podcast_dir"

# Push that zip to the backup location
echo "Pushing $bak to $dest on port $port"
scp -P $port "$bak" "$dest"

0 comments on commit 0f5892e

Please sign in to comment.