Date/Timestamp Log File

I'm trying to format a log file with a date/timestamp every time I run rclone move.

--log-file /home/user/logs/rclone-move-date +%Y%m%d_%H%M.log

A rclone-move-date file is created, not a log file.
It has the error
Command move needs 2 arguments maximum: you provided 3 non flag arguments: ["+%Y%m%d_%H%M.log" "/home/user/gd/" "gcrypt:"]

How do you properly timestamp a log file?

I'm assuming you are on some Linux type system as you'd have to escape the date as you need to grab that first.

So something like:

echo "blah" >> test-`date +"%Y%m%d%H%M"`.log
[felix@gemini ~]$ ls -al test-201908250910.log
-rw-rw-r-- 1 felix felix 5 Aug 25 09:10 test-201908250910.log

If that's what you are going for.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.