gui, man, authors: Update docs, translations, and contributors

This commit is contained in:
Jakob Borg
2021-03-17 07:45:40 +01:00
parent 3f2b584c4e
commit 1814f4693d
17 changed files with 97 additions and 25 deletions
+69 -4
View File
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-VERSIONING" "7" "Mar 09, 2021" "v1" "Syncthing"
.TH "SYNCTHING-VERSIONING" "7" "Mar 11, 2021" "v1" "Syncthing"
.SH NAME
syncthing-versioning \- Keep automatic backups of deleted files by other nodes
.
@@ -179,7 +179,8 @@ $ /Users/jb/bin/onlylatest.sh /Users/jb/Sync docs/letter.txt
The script will then move the file in question to
\fB~/.trashcan/docs/letter.txt\fP, replacing any previous version of that letter
that may already have been there.
.SS Example for Windows
.SS Examples for Windows
.SS Move to a given folder using the command prompt (CMD)
.sp
On Windows we can use a batch script to perform the same “trash can”\-like
behavior as mentioned above. I created the following script and saved it as
@@ -215,8 +216,72 @@ move /Y "%FOLDER_PATH%\e%FILE_PATH%" "%VERSIONS_PATH%\e%FILE_PATH%"
.UNINDENT
.UNINDENT
.sp
Finally, I set \fBC:\eUsers\emfrnd\eScripts\eonlylatest.bat %FOLDER_PATH% %FILE_PATH%\fP
as the command name in Syncthing.
Finally, I set \fB"C:\eUsers\emfrnd\eScripts\eonlylatest.bat" "%FOLDER_PATH%"
"%FILE_PATH%"\fP as the command name in Syncthing.
.SS Move to the Recycle Bin using PowerShell
.sp
We can use PowerShell to send files directly to the Recycle Bin, which
mimics the behaviour of deleting them using the Windows Explorer.
Firstly, create the following script and save it in your preferred
location, e.g. \fBC:\eUsers\eUser\eScripts\eSendToRecycleBin.ps1\fP\&.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# PowerShell has no native method to recycle files, so we use Visual
# Basic to perform the operation. If succeeded, we also include the
# recycled file in the Syncthing\(aqs DEBUG output.
Add\-Type \-AssemblyName Microsoft.VisualBasic
[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile($args,\(aqOnlyErrorDialogs\(aq,\(aqSendToRecycleBin\(aq)
if ($?) {
Write\-Output ("Recycled " + $args + ".")
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Alternatively, the script can be expanded to send only deleted files to
the Recycle Bin, and permanently delete modified ones, which makes it
more consistent with how the Explorer works.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# PowerShell has no native method to recycle files, so we use Visual
# Basic to perform the operation.
Add\-Type \-AssemblyName Microsoft.VisualBasic
# We need to test if a Syncthing .tmp file exists. If it does, we assume
# a modification and delete the existing file. If if does not, we assume
# a deletion and recycle the current file. If succeeded, we also include
# the deleted/recycled file in the Syncthing\(aqs DEBUG output.
if (Test\-Path \-LiteralPath ((Split\-Path \-Path $args) + "\e~syncthing~" + (Split\-Path \-Path $args \-Leaf) + ".tmp")) {
[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile($args,\(aqOnlyErrorDialogs\(aq,\(aqDeletePermanently\(aq)
if ($?) {
Write\-Output ("Deleted " + $args + ".")
}
} else {
[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile($args,\(aqOnlyErrorDialogs\(aq,\(aqSendToRecycleBin\(aq)
if ($?) {
Write\-Output ("Recycled " + $args + ".")
}
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Finally, we set the command name in Syncthing to \fBpowershell.exe
\-ExecutionPolicy Bypass \-File "C:\eUsers\eUser\eScripts\eSendToRecycleBin.ps1"
"%FOLDER_PATH%\e%FILE_PATH%"\fP\&.
.sp
The only caveat that you should be aware of is that if your Syncthing
folder is located on a portable storage, such as a USB stick, or if you
have the Recycle Bin disabled, then the script will end up deleting all
files permanently.
.SH AUTHOR
The Syncthing Authors
.SH COPYRIGHT