@@ -30,9 +30,9 @@ addition, they create an empty file in place of the original one. This
3030is useful for log rotation. ` backup() ` , ` backup_date() ` and
3131` backup_time() ` do the same but keep the original file.
3232
33- rotor also includes a few utility functions for examining backups of a
34- file: ` list_backups() ` , ` backup_info() ` , ` n_backups ` , ` newest_backup() ` ,
35- ` oldest_backup() ` . See the [ function
33+ rotor also includes utility functions for finding and examining the
34+ backups of a file: ` list_backups() ` , ` backup_info() ` , ` n_backups ` ,
35+ ` newest_backup() ` , ` oldest_backup() ` . See the [ function
3636reference] ( https://s-fleck.github.io/rotor/reference/index.html ) for
3737details.
3838
@@ -83,8 +83,8 @@ backup(tf, compression = TRUE)
8383
8484# display backups of a file
8585list_backups(tf )
86- # > [1] "/tmp/RtmppxEUB8 /rotor/mylogfile.1.log.zip"
87- # > [2] "/tmp/RtmppxEUB8 /rotor/mylogfile.2.log"
86+ # > [1] "/tmp/RtmpT5fN3W /rotor/mylogfile.1.log.zip"
87+ # > [2] "/tmp/RtmpT5fN3W /rotor/mylogfile.2.log"
8888```
8989
9090` rotate() ` also backs up a file, but replaces the original file with an
@@ -93,9 +93,9 @@ empty one.
9393``` r
9494rotate(tf )
9595list_backups(tf )
96- # > [1] "/tmp/RtmppxEUB8 /rotor/mylogfile.1.log"
97- # > [2] "/tmp/RtmppxEUB8 /rotor/mylogfile.2.log.zip"
98- # > [3] "/tmp/RtmppxEUB8 /rotor/mylogfile.3.log"
96+ # > [1] "/tmp/RtmpT5fN3W /rotor/mylogfile.1.log"
97+ # > [2] "/tmp/RtmpT5fN3W /rotor/mylogfile.2.log.zip"
98+ # > [3] "/tmp/RtmpT5fN3W /rotor/mylogfile.3.log"
9999
100100# the original file is now empty
101101readLines(tf )
@@ -118,10 +118,10 @@ backup(tf, max_backups = 4)
118118backup(tf , max_backups = 4 )
119119
120120list_backups(tf )
121- # > [1] "/tmp/RtmppxEUB8 /rotor/mylogfile.1.log"
122- # > [2] "/tmp/RtmppxEUB8 /rotor/mylogfile.2.log"
123- # > [3] "/tmp/RtmppxEUB8 /rotor/mylogfile.3.log"
124- # > [4] "/tmp/RtmppxEUB8 /rotor/mylogfile.4.log.zip"
121+ # > [1] "/tmp/RtmpT5fN3W /rotor/mylogfile.1.log"
122+ # > [2] "/tmp/RtmpT5fN3W /rotor/mylogfile.2.log"
123+ # > [3] "/tmp/RtmpT5fN3W /rotor/mylogfile.3.log"
124+ # > [4] "/tmp/RtmpT5fN3W /rotor/mylogfile.4.log.zip"
125125```
126126
127127We can also use ` prune_backups() ` to delete old backups. Other than
@@ -154,30 +154,30 @@ backup_time(tf, format = "%Y-%m-%d_%H-%M-%S") # Python logging
154154backup_time(tf , format = " %Y%m%dT%H%M%S" ) # ISO 8601 compatible
155155
156156backup_info(tf )
157- # > path
158- # > 1 /tmp/RtmppxEUB8 /rotor/mylogfile.2019-05-30_23-15-33 .log
159- # > 2 /tmp/RtmppxEUB8 /rotor/mylogfile.2019-05-30--23-15-33 .log
160- # > 5 /tmp/RtmppxEUB8 /rotor/mylogfile.20190530T231533 .log
161- # > 3 /tmp/RtmppxEUB8 /rotor/mylogfile.2019-05-30 .log
162- # > 4 /tmp/RtmppxEUB8 /rotor/mylogfile.2019-05.log
163- # > dir name sfx ext size isdir mode
164- # > 1 /tmp/RtmppxEUB8/rotor mylogfile 2019-05-30_23-15-33 log 26 FALSE 664
165- # > 2 /tmp/RtmppxEUB8/rotor mylogfile 2019-05-30--23-15-33 log 26 FALSE 664
166- # > 5 /tmp/RtmppxEUB8/rotor mylogfile 20190530T231533 log 26 FALSE 664
167- # > 3 /tmp/RtmppxEUB8/rotor mylogfile 2019-05-30 log 26 FALSE 664
168- # > 4 /tmp/RtmppxEUB8/rotor mylogfile 2019-05 log 26 FALSE 664
169- # > mtime ctime atime uid gid
170- # > 1 2019-05-30 23:15:33 2019-05-30 23:15:33 2019-05-30 23:15:33 1000 1000
171- # > 2 2019-05-30 23:15:33 2019-05-30 23:15:33 2019-05-30 23:15:33 1000 1000
172- # > 5 2019-05-30 23:15:33 2019-05-30 23:15:33 2019-05-30 23:15:33 1000 1000
173- # > 3 2019-05-30 23:15:33 2019-05-30 23:15:33 2019-05-30 23:15:33 1000 1000
174- # > 4 2019-05-30 23:15:33 2019-05-30 23:15:33 2019-05-30 23:15:33 1000 1000
175- # > uname grname timestamp
176- # > 1 hoelk hoelk 2019-05-30 23:15:33
177- # > 2 hoelk hoelk 2019-05-30 23:15:33
178- # > 5 hoelk hoelk 2019-05-30 23:15:33
179- # > 3 hoelk hoelk 2019-05-30 00:00:00
180- # > 4 hoelk hoelk 2019-05-01 00:00:00
157+ # > path name
158+ # > 1 /tmp/RtmpT5fN3W /rotor/mylogfile.2019-05-31_06-48-27 .log mylogfile
159+ # > 2 /tmp/RtmpT5fN3W /rotor/mylogfile.2019-05-31--06-48-27 .log mylogfile
160+ # > 5 /tmp/RtmpT5fN3W /rotor/mylogfile.20190531T064827 .log mylogfile
161+ # > 3 /tmp/RtmpT5fN3W /rotor/mylogfile.2019-05-31 .log mylogfile
162+ # > 4 /tmp/RtmpT5fN3W /rotor/mylogfile.2019-05.log mylogfile
163+ # > sfx ext size isdir mode mtime
164+ # > 1 2019-05-31_06-48-27 log 26 FALSE 664 2019-05-31 06:48:27
165+ # > 2 2019-05-31--06-48-27 log 26 FALSE 664 2019-05-31 06:48:27
166+ # > 5 20190531T064827 log 26 FALSE 664 2019-05-31 06:48:27
167+ # > 3 2019-05-31 log 26 FALSE 664 2019-05-31 06:48:26
168+ # > 4 2019-05 log 26 FALSE 664 2019-05-31 06:48:26
169+ # > ctime atime uid gid uname grname
170+ # > 1 2019-05-31 06:48:27 2019-05-31 06:48:27 1000 1000 hoelk hoelk
171+ # > 2 2019-05-31 06:48:27 2019-05-31 06:48:27 1000 1000 hoelk hoelk
172+ # > 5 2019-05-31 06:48:27 2019-05-31 06:48:27 1000 1000 hoelk hoelk
173+ # > 3 2019-05-31 06:48:26 2019-05-31 06:48:26 1000 1000 hoelk hoelk
174+ # > 4 2019-05-31 06:48:26 2019-05-31 06:48:26 1000 1000 hoelk hoelk
175+ # > timestamp
176+ # > 1 2019-05-31 06:48:27
177+ # > 2 2019-05-31 06:48:27
178+ # > 5 2019-05-31 06:48:27
179+ # > 3 2019-05-31 00:00:00
180+ # > 4 2019-05-01 00:00:00
181181```
182182
183183If we examine the “timestamp” column in the example above, we see that
0 commit comments