@@ -83,8 +83,8 @@ backup(tf, compression = TRUE)
8383
8484# display backups of a file
8585list_backups(tf )
86- # > [1] "/tmp/RtmpT5fN3W /rotor/mylogfile.1.log.zip"
87- # > [2] "/tmp/RtmpT5fN3W /rotor/mylogfile.2.log"
86+ # > [1] "/tmp/RtmpOyN1LN /rotor/mylogfile.1.log.zip"
87+ # > [2] "/tmp/RtmpOyN1LN /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/RtmpT5fN3W /rotor/mylogfile.1.log"
97- # > [2] "/tmp/RtmpT5fN3W /rotor/mylogfile.2.log.zip"
98- # > [3] "/tmp/RtmpT5fN3W /rotor/mylogfile.3.log"
96+ # > [1] "/tmp/RtmpOyN1LN /rotor/mylogfile.1.log"
97+ # > [2] "/tmp/RtmpOyN1LN /rotor/mylogfile.2.log.zip"
98+ # > [3] "/tmp/RtmpOyN1LN /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/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"
121+ # > [1] "/tmp/RtmpOyN1LN /rotor/mylogfile.1.log"
122+ # > [2] "/tmp/RtmpOyN1LN /rotor/mylogfile.2.log"
123+ # > [3] "/tmp/RtmpOyN1LN /rotor/mylogfile.3.log"
124+ # > [4] "/tmp/RtmpOyN1LN /rotor/mylogfile.4.log.zip"
125125```
126126
127127We can also use ` prune_backups() ` to delete old backups. Other than
@@ -155,35 +155,35 @@ backup_time(tf, format = "%Y%m%dT%H%M%S") # ISO 8601 compatible
155155
156156backup_info(tf )
157157# > 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
158+ # > 1 /tmp/RtmpOyN1LN /rotor/mylogfile.2019-06-17_09-55-44 .log mylogfile
159+ # > 2 /tmp/RtmpOyN1LN /rotor/mylogfile.2019-06-17--09-55-44 .log mylogfile
160+ # > 5 /tmp/RtmpOyN1LN /rotor/mylogfile.20190617T095544 .log mylogfile
161+ # > 3 /tmp/RtmpOyN1LN /rotor/mylogfile.2019-06-17 .log mylogfile
162+ # > 4 /tmp/RtmpOyN1LN /rotor/mylogfile.2019-06 .log mylogfile
163163# > 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
164+ # > 1 2019-06-17_09-55-44 log 26 FALSE 664 2019-06-17 09:55:44
165+ # > 2 2019-06-17--09-55-44 log 26 FALSE 664 2019-06-17 09:55:44
166+ # > 5 20190617T095544 log 26 FALSE 664 2019-06-17 09:55:44
167+ # > 3 2019-06-17 log 26 FALSE 664 2019-06-17 09:55:44
168+ # > 4 2019-06 log 26 FALSE 664 2019-06-17 09:55:44
169169# > 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
170+ # > 1 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
171+ # > 2 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
172+ # > 5 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
173+ # > 3 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
174+ # > 4 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
175175# > 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
176+ # > 1 2019-06-17 09:55:44
177+ # > 2 2019-06-17 09:55:44
178+ # > 5 2019-06-17 09:55:44
179+ # > 3 2019-06-17 00:00:00
180+ # > 4 2019-06 -01 00:00:00
181181```
182182
183183If we examine the “timestamp” column in the example above, we see that
184184missing date information is always interpreted as the start of the
185185period; i.e. so ` "2019-01" ` is equivalent to ` "2019-01-01--00--00--00" `
186- for all intentds and purposes.
186+ for all intents and purposes.
187187
188188``` r
189189prune_backups(tf , max_backups = 0 ) # cleanup
@@ -212,7 +212,7 @@ two non-base dependencies:
212212 - [ dint] ( https://github.com/s-fleck/dint ) : A toolkit for working
213213 year-quarter and year-month dates that I am also the author of. It
214214 is used by ` rotate_date() ` and ` rotate_time() ` to deal with calendar
215- periods.
215+ periods (such as weeks or months) .
216216
217217Both packages have no transitive dependencies (i.e they do not depend on
218218anything outside of base R)
0 commit comments