Skip to content

Instantly share code, notes, and snippets.

@TatsuyaOGth
Last active September 17, 2021 12:53
Show Gist options
  • Save TatsuyaOGth/c9bae4d368cbea6456c481d338faf914 to your computer and use it in GitHub Desktop.
Save TatsuyaOGth/c9bae4d368cbea6456c481d338faf914 to your computer and use it in GitHub Desktop.
rsync_commands
# ローカルフォルダ
local="rsync_test_dir"
# リモートフォルダ
remote="rsync://[email protected]/public/rsync"
# ローカルのバックアップ保存先
local_backup="./_deleted_files/$(date +%Y-%m-%d_%H-%M-%S)"
# リモートのバックアップの保存先
remote_backup="../../_deleted_files/$(date +%Y-%m-%d_%H-%M-%S)"
# 除外ファイル
exclude_file="rsync_ignore.txt"
.DS_Store
*/_deleted_files/
.git/
*~
.Trash
#======================================================================================
# Unity
#======================================================================================
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
[Ll]ogs/
[Uu]ser[Ss]ettings/
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
[Mm]emoryCaptures/
# Asset meta data should only be ignored when the corresponding asset is also ignored
+ [Aa]ssets/**/*.meta
# Uncomment this line if you wish to ignore the asset store tools plugin
# [Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
[Aa]ssets/Plugins/Editor/JetBrains*
# Visual Studio cache directory
.vs/
# Gradle cache directory
.gradle/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta
# Unity3D generated file on crash reports
sysinfo.txt
# Builds
*.apk
*.aab
*.unitypackage
# Crashlytics generated file
crashlytics-build.properties
# Packed Addressables
[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
# Temporary auto-generated Android Assets
[Aa]ssets/[Ss]treamingAssets/aa.meta
[Aa]ssets/[Ss]treamingAssets/aa/*
#!/bin/sh
echo "この操作では、リモートのファイルを自分のファイルにダウンロードします(ローカルの変更が失われる可能性があります)"
echo "実行してよろしいですか? [y/N]:"
read ans
if [[ $ans = [yY] ]]; then
cd `dirname $0`
. ./rsync_config.txt
rsync -ahvz --delete --backup --backup-dir=${local_backup} --exclude-from=${exclude_file} ${remote}/${local} ./
fi
#!/bin/sh
echo "この操作では、自分のファイルをリモートストレージにアップロードします"
echo "実行してよろしいですか? [y/N]:"
read ans
if [[ $ans = [yY] ]]; then
cd `dirname $0`
. ./rsync_config.txt
rsync -ahvz --delete --backup --backup-dir=${remote_backup} --exclude-from=${exclude_file} ${local} ${remote}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment