-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
650 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ jobs: | |
uses: actions/upload-artifact@v4 | ||
with: | ||
path: SimpleFolderSyncer.msi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Simple Folder Syncer | ||
|
||
Currently workin progress. Updates to the Docs will follow... | ||
The | ||
|
||
## Prerequisites | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
@echo off | ||
|
||
set "BatchFilePath='%programfiles%\Simple Folder Syncer\simple-folder-syncer.exe'" | ||
set "ReconnectDrivePath='%programfiles%\Simple Folder Syncer\reconnect-netdrive.bat'" | ||
|
||
set "TaskName=Simple Folder Syncer" | ||
set "TaskDescription=Run my batch file daily" | ||
|
||
:: https://learn.microsoft.com/de-de/windows/win32/taskschd/schtasks | ||
schtasks /create /f /tn "%TaskName%" /tr "%BatchFilePath%" /sc hourly | ||
@REM https://learn.microsoft.com/de-de/windows/win32/taskschd/schtasks | ||
schtasks /create /f /tn "%TaskName%" /tr "%BatchFilePath%" /sc hourly /mo 1 | ||
|
||
@REM This is only a workaround until the actual SSHFS drive reconnecting is implemented. | ||
schtasks /create /f /tn "Reconnect SSHFS drive" /tr "%ReconnectDrivePath%" /sc minute /mo 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@echo off | ||
|
||
setlocal enabledelayedexpansion | ||
|
||
for /F "tokens=*" %%l in ('net use ^| findstr /i "\\sshfs"') do set net_use_line=%%l | ||
|
||
for %%a in (%net_use_line%) do ( | ||
echo %%a|find "\\sshfs" >nul | ||
|
||
if errorlevel 1 ( | ||
set previous=%%a | ||
) else ( | ||
set drive=!previous! | ||
) | ||
) | ||
|
||
IF [!drive!] == [] ( | ||
exit /B 0 | ||
) | ||
|
||
for %%a in (%net_use_line%) do ( | ||
if "%%a"=="%drive%" ( | ||
set "nextToken=1" | ||
) else if defined nextToken ( | ||
set "remote=%%a" | ||
set "nextToken=" | ||
) | ||
) | ||
|
||
IF [!remote!] == [] ( | ||
exit /B 0 | ||
) | ||
|
||
echo Drive: !drive! | ||
echo Remote: !remote! | ||
|
||
|
||
if not exist "!drive!" ( | ||
echo Reconnect drive now... | ||
net use !drive! !remote! | ||
) else ( | ||
echo Nothing to do. Drive is already connected. | ||
) | ||
|
||
endlocal | ||
|
||
exit /B 0 |
Oops, something went wrong.