I'm trying to setup rclone logging to systemd, because I use it in a python script that logs to systemd, I'm using a local filesystem, folder test has two files a and b; folder test2 is empty.
If I change --log-systemd flag to --log-file=file.txt the log appears correctly in the log-file.
I'm running rclone as a normal user, from the bash terminal.
What is your rclone version (output from rclone version)
rclone v1.56.0
os/version: arch 21.1.3 (64 bit)
os/kernel: 5.13.16-xanmod1-MANJARO (x86_64)
os/type: linux
os/arch: amd64
go/version: go1.16.6
go/linking: dynamic
go/tags: none
Whicnoh OS you are using and how many bits (eg Windows 7, 64 bit)
Manjaro GNOME, 64 bit
Which cloud storage system are you using? (eg Google Drive)
Local storage
The command you were trying to run (eg rclone copy /tmp remote:tmp)
rclone sync test test2 -vv --log-systemd
and then
journalctl -r
I also tried journaclt -r | grep someexpressionthatshowedupinthelogfile
The rclone config contents with secrets removed.
[onedrive]
type = onedrive
token = {"access_token":"XXXX","token_type":"Bearer","refresh_token":"XXXX","expiry":"XXXX"}
drive_id = XXXX
drive_type = personal
[gdriveuff]
type = drive
scope = drive
token = {"access_token":"XXXX","token_type":"Bearer","refresh_token":"XXXX","expiry":"XXXX"}
root_folder_id = XXXX
client_id = XXXX
client_secret = XXXX
[gdrivepessoal]
type = drive
scope = drive
token = {"access_token":"XXXX","token_type":"Bearer","refresh_token":"XXXX","expiry":"XXXX"}
[filmesseries_crypt]
type = crypt
remote = gdriveuff:filmesseries_crypt
filename_encryption = standard
directory_name_encryption = true
password = XXXX
A log from the command with the -vv flag
<7>DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "sync" "test" "test2" "-vv" "--log-systemd"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote "test"
<7>DEBUG : Using config file from "/home/gustavo/.config/rclone/rclone.conf"
<7>DEBUG : fs cache: renaming cache item "test" to be canonical "/home/gustavo/kjfkdjs/test"
<7>DEBUG : Creating backend with remote "test2"
<7>DEBUG : fs cache: renaming cache item "test2" to be canonical "/home/gustavo/kjfkdjs/test2"
<7>DEBUG : Local file system at /home/gustavo/kjfkdjs/test2: Waiting for checks to finish
<7>DEBUG : Local file system at /home/gustavo/kjfkdjs/test2: Waiting for transfers to finish
<7>DEBUG : b: md5 = d41d8cd98f00b204e9800998ecf8427e OK
<6>INFO : b: Copied (new)
<7>DEBUG : a: md5 = d41d8cd98f00b204e9800998ecf8427e OK
<6>INFO : a: Copied (new)
<7>DEBUG : Waiting for deletions to finish
<6>INFO :
Transferred: 0 / 0 Byte, -, 0 Byte/s, ETA -
Transferred: 2 / 2, 100%
Elapsed time: 0.0s
<7>DEBUG : 3 go routines active
Ps: To help out in parameter exclusion, I've tried the same command with a local storage configured using rclone conf, here are the results:
Command:
rclone sync test test2 -vv --log-systemd
and
journalctl -r
rclone.conf
[onedrive]
type = onedrive
token = {"access_token":"XXXX","token_type":"Bearer","refresh_token":"XXXX","expiry":"XXXX"}
drive_id = XXXX
drive_type = personal
[gdriveuff]
type = drive
scope = drive
token = {"access_token":"XXXX","token_type":"Bearer","refresh_token":"XXXX","expiry":"XXXX"}
root_folder_id = XXXX
client_id = XXXX
client_secret = XXXX
[gdrivepessoal]
type = drive
scope = drive
token = {"access_token":"XXXX","token_type":"Bearer","refresh_token":"XXXX","expiry":"XXXX"}
[filmesseries_crypt]
type = crypt
remote = gdriveuff:filmesseries_crypt
filename_encryption = standard
directory_name_encryption = true
password = XXXX
[local]
type = local
A log from the command line with the -vv flag
<7>DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "sync" "test" "test2" "-vv" "--log-systemd"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote "test"
<7>DEBUG : Using config file from "/home/gustavo/.config/rclone/rclone.conf"
<7>DEBUG : fs cache: renaming cache item "test" to be canonical "/home/gustavo/kjfkdjs/test"
<7>DEBUG : Creating backend with remote "test2"
<7>DEBUG : fs cache: renaming cache item "test2" to be canonical "/home/gustavo/kjfkdjs/test2"
<7>DEBUG : Local file system at /home/gustavo/kjfkdjs/test2: Waiting for checks to finish
<7>DEBUG : a: Size and modification time the same (differ by 0s, within tolerance 1ns)
<7>DEBUG : b: Size and modification time the same (differ by 0s, within tolerance 1ns)
<7>DEBUG : a: Unchanged skipping
<7>DEBUG : b: Unchanged skipping
<7>DEBUG : Local file system at /home/gustavo/kjfkdjs/test2: Waiting for transfers to finish
<7>DEBUG : Waiting for deletions to finish
<6>INFO : There was nothing to transfer
<6>INFO :
Transferred: 0 / 0 Byte, -, 0 Byte/s, ETA -
Checks: 2 / 2, 100%
Elapsed time: 0.0s
Another update:
Commands: rclone ls onedrive: -vv --log-systemd rclone ls onedrive: -vv --log-file=t.txt
Logs show up in the log-file but not on systemd. Here's the contents of test.txt:
2021/09/21 23:09:09 DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "ls" "onedrive:" "-vv" "--log-file=t.txt"]
2021/09/21 23:09:09 DEBUG : Creating backend with remote "onedrive:"
2021/09/21 23:09:09 DEBUG : Using config file from "/home/gustavo/.config/rclone/rclone.conf"
2021/09/21 23:09:14 DEBUG : Clima Carioca Engenharia - Anotações do Gustavo: OneNote file not shown in directory listing
2021/09/21 23:09:14 DEBUG : Estudos de Concursos: OneNote file not shown in directory listing
2021/09/21 23:09:14 DEBUG : Guia do OneNote 2010: OneNote file not shown in directory listing
2021/09/21 23:09:14 DEBUG : Gustavo's Notebook: OneNote file not shown in directory listing
2021/09/21 23:09:14 DEBUG : No: OneNote file not shown in directory listing
2021/09/21 23:09:14 DEBUG : No2: OneNote file not shown in directory listing
2021/09/21 23:09:14 DEBUG : No3: OneNote file not shown in directory listing
2021/09/21 23:19:12 DEBUG : 3 go routines active
The log-from command line basically the contents of test.txt plus a million files listed, that's why I won't post it here.
Thank you @Animosity022, I will definitely follow that, now I feel kinda embarassed .
But if I may say, the documentation on the website might need some updating:
In Global Flags, --log-systemd is listed as a flag that is available for every command, but in reality it only does something if you use commands mount and rcd.