# A sync script example for Steam Deck that syncs game screenshots to a common directory, which is backed up to the the cloud (Unraid in my case)

**URL:** <https://forum.hhf.technology/t/a-sync-script-example-for-steam-deck-that-syncs-game-screenshots-to-a-common-directory-which-is-backed-up-to-the-the-cloud-unraid-in-my-case/217>\
**Category:** Off-topic\
**Tags:** steam-deck, unraid\
**Created:** [October 16, 2024, 5:43am UTC](https://forum.hhf.technology/t/a-sync-script-example-for-steam-deck-that-syncs-game-screenshots-to-a-common-directory-which-is-backed-up-to-the-the-cloud-unraid-in-my-case/217 "2024-10-16T05:43:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 16, 2024, 5:43am UTC](https://forum.hhf.technology/t/a-sync-script-example-for-steam-deck-that-syncs-game-screenshots-to-a-common-directory-which-is-backed-up-to-the-the-cloud-unraid-in-my-case/217/1 "2024-10-16T05:43:07Z")

</div>

```bash
#!/bin/bash
# =========================================================================== #
# Description: A sync script example for Steam Deck that syncs game screenshots to a common directory, which is backed up to the the cloud.
# Details: A sync script example for Steam Deck that syncs game screenshots to a common directory, which is backed up to the the cloud.
# Made for: Linux, Steam Deck, Unraid (Debian & Ubuntu).
# Requirements: ssh-keygen - ssh-copy-id root@127.0.0.1 (replace IP)
# Make executable: chmod +x sync-steamdeck-screenshots.sh
# Crontab @weekly: 0 0 * * MON /home/{PATH}/sync-steamdeck-screenshots.sh > /home/{PATH}/sync-steamdeck-screenshots.log 2>&1
# =========================================================================== #
#
# Variables

# setup vars
STEAM_USERID="YOUR_NUMERIC_USERID"

# Setup source directory vars
# Note: Games like AC Odyssey don't use the same sync dir so you have
# to sleuth in desktop mode to find the right directory
## Games
## Steam System Screenshots (steambutton + r2)
STEAM_SYSTEM_SS="/home/deck/.local/share/Steam/userdata/$STEAM_USERID/760/remote"
### No Mans Sky
NMS_SS_ORIGIN="/home/deck/.local/share/Steam/userdata/$STEAM_USERID/760/remote/275850/screenshots"
### AC Odyssey
AC_SS_ORIGIN="/home/deck/.steam/steam/steamapps/compatdata/812140/pfx/drive_c/users/steamuser/Documents/Assassin's Creed Odyssey/photos"

# Setup destination directories
## root dir for all screenshot sync folders
SYNC_DIR="/home/deck/Synology/Games/Steam Deck"

## actual source dirs
## note: this script assumes thes dirs already exist (runs naively)
STEAM_SYSTEM_DEST="$SYNC_DIR/Steam_System_Screenshots"
NMS_DEST="$SYNC_DIR/NoMansSky"
AC_DEST="$SYNC_DIR/AssasinsCreed_Odyssey"

# setup sync function
sync_ss() {
    # sync origin to dest
    rsync -a --no-times --checksum "$1" "$2"
}

# perform the sync for each game 
# from source ss folder to dest
sync_ss "$STEAM_SYSTEM_SS" "$STEAM_SYSTEM_DEST"
sync_ss "$NMS_SS_ORIGIN" "$NMS_DEST"
sync_ss "$AC_SS_ORIGIN" "$AC_DEST"

# note: in my case I have unraid to perform a sync task
# with this directory, but you may also use a network drive,
# external drive, Dropbox, or any other service to auto-transport
# your images to a place that is better for you to manage and share them.
```
