Compare commits

...

2 Commits

Author SHA1 Message Date
Tatsh ccc75ba15b
Merge fc65d815f7 into 6901fbb169 2021-12-01 18:14:14 -07:00
Andrew Udvare fc65d815f7 Add macOS launchd files for automatic syncing 2021-05-31 03:07:59 -04:00
4 changed files with 81 additions and 0 deletions

View File

@ -23,5 +23,14 @@ if ( HAVE_SYSTEMD )
add_subdirectory( systemd ) add_subdirectory( systemd )
endif( HAVE_SYSTEMD ) endif( HAVE_SYSTEMD )
find_program(
HAVE_LAUNCHD launchd
PATHS /sbin
NO_DEFAULT_PATH
)
if ( HAVE_LAUNCHD )
add_subdirectory( launchd )
endif( HAVE_LAUNCHD )
add_subdirectory( libgrive ) add_subdirectory( libgrive )
add_subdirectory( grive ) add_subdirectory( grive )

27
launchd/CMakeLists.txt Normal file
View File

@ -0,0 +1,27 @@
SET(GRIVE_SYNC_SH_BINARY "${CMAKE_INSTALL_PREFIX}/lib/grive/grive-sync.sh")
CONFIGURE_FILE(
com.github.vitalif.grive2.grive-changes.plist.in
com.github.vitalif.grive2.grive-changes.plist
@ONLY
)
CONFIGURE_FILE(
com.github.vitalif.grive2.grive-timer.plist.in
com.github.vitalif.grive2.grive-timer.plist
@ONLY
)
install(
FILES
${CMAKE_BINARY_DIR}/launchd/com.github.vitalif.grive2.grive-changes.plist
${CMAKE_BINARY_DIR}/launchd/com.github.vitalif.grive2.grive-timer.plist
DESTINATION
lib/launchd
)
install(
PROGRAMS
../systemd/grive-sync.sh
DESTINATION
lib/grive
)

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.vitalif.grive2.grive-changes</string>
<key>ProgramArguments</key>
<array>
<string>@GRIVE_SYNC_SH_BINARY@</string>
<string>listen</string>
<string>RELATIVE PATH FROM $HOME TO SYNC HERE</string>
</array>
<key>RunAtLoad</key>
<true />
<key>StandardOutPath</key>
<!-- Change HOME below to your $HOME path, e.g. /Users/name -->
<string>HOME/Library/Logs/grive2.log</string>
<key>StandardErrorPath</key>
<string>HOME/Library/Logs/grive2.log</string>
</dict>
</plist>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.github.vitalif.grive2.grive-timer</string>
<key>ProgramArguments</key>
<array>
<string>@GRIVE_SYNC_SH_BINARY@</string>
<string>sync</string>
<string>RELATIVE PATH FROM $HOME TO SYNC HERE</string>
</array>
<key>RunAtLoad</key>
<true />
<key>StartInterval</key>
<!-- Every 5 minutes -->
<integer>300</integer>
<key>StandardOutPath</key>
<!-- Change HOME below to your $HOME path, e.g. /Users/name -->
<string>HOME/Library/Logs/grive2.log</string>
<key>StandardErrorPath</key>
<string>HOME/Library/Logs/grive2.log</string>
</dict>
</plist>