diff --git a/.Rbuildignore b/.Rbuildignore index 447c05b..4047504 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,4 @@ ^CRAN-RELEASE$ ^codecov\.yml$ ^vignettes/benchmarks\.Rmd$ +^revdep$ diff --git a/DESCRIPTION b/DESCRIPTION index 56fbec9..40debb7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: rotor Title: Log Rotation and Conditional Backups -Version: 0.2.2.9000 +Version: 0.2.3 Authors@R: person(given = "Stefan", family = "Fleck", diff --git a/NEWS.md b/NEWS.md index c4e3d67..0e22fc4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# rotor 0.2.2.9000 +# rotor 0.2.3 * Changed default behaviour of `rotate_date()`, `rotate_time()`, etc...: If no backups exist of target file, use the "created" timestamp diff --git a/README.Rmd b/README.Rmd index 83e90f7..47089cd 100644 --- a/README.Rmd +++ b/README.Rmd @@ -141,7 +141,7 @@ backup_info(tf) ``` If we examine the "timestamp" column in the example above, we see that missing date information is always interpreted as the start of the period; i.e. so -`"2019-01"` is equivalent to `"2019-01-01--00--00--00"` for all intentds and +`"2019-01"` is equivalent to `"2019-01-01--00--00--00"` for all intents and purposes. ```{r} @@ -173,7 +173,8 @@ non-base dependencies: encapsulated object-oriented programming. * [dint](https://github.com/s-fleck/dint): A toolkit for working year-quarter and year-month dates that I am also the author of. It is used by - `rotate_date()` and `rotate_time()` to deal with calendar periods. + `rotate_date()` and `rotate_time()` to deal with calendar periods (such as + weeks or months). Both packages have no transitive dependencies (i.e they do not depend on anything outside of base R) diff --git a/README.md b/README.md index 1b00f76..064abf3 100644 --- a/README.md +++ b/README.md @@ -83,8 +83,8 @@ backup(tf, compression = TRUE) # display backups of a file list_backups(tf) -#> [1] "/tmp/RtmpT5fN3W/rotor/mylogfile.1.log.zip" -#> [2] "/tmp/RtmpT5fN3W/rotor/mylogfile.2.log" +#> [1] "/tmp/RtmpOyN1LN/rotor/mylogfile.1.log.zip" +#> [2] "/tmp/RtmpOyN1LN/rotor/mylogfile.2.log" ``` `rotate()` also backs up a file, but replaces the original file with an @@ -93,9 +93,9 @@ empty one. ``` r rotate(tf) list_backups(tf) -#> [1] "/tmp/RtmpT5fN3W/rotor/mylogfile.1.log" -#> [2] "/tmp/RtmpT5fN3W/rotor/mylogfile.2.log.zip" -#> [3] "/tmp/RtmpT5fN3W/rotor/mylogfile.3.log" +#> [1] "/tmp/RtmpOyN1LN/rotor/mylogfile.1.log" +#> [2] "/tmp/RtmpOyN1LN/rotor/mylogfile.2.log.zip" +#> [3] "/tmp/RtmpOyN1LN/rotor/mylogfile.3.log" # the original file is now empty readLines(tf) @@ -118,10 +118,10 @@ backup(tf, max_backups = 4) backup(tf, max_backups = 4) list_backups(tf) -#> [1] "/tmp/RtmpT5fN3W/rotor/mylogfile.1.log" -#> [2] "/tmp/RtmpT5fN3W/rotor/mylogfile.2.log" -#> [3] "/tmp/RtmpT5fN3W/rotor/mylogfile.3.log" -#> [4] "/tmp/RtmpT5fN3W/rotor/mylogfile.4.log.zip" +#> [1] "/tmp/RtmpOyN1LN/rotor/mylogfile.1.log" +#> [2] "/tmp/RtmpOyN1LN/rotor/mylogfile.2.log" +#> [3] "/tmp/RtmpOyN1LN/rotor/mylogfile.3.log" +#> [4] "/tmp/RtmpOyN1LN/rotor/mylogfile.4.log.zip" ``` We 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 backup_info(tf) #> path name -#> 1 /tmp/RtmpT5fN3W/rotor/mylogfile.2019-05-31_06-48-27.log mylogfile -#> 2 /tmp/RtmpT5fN3W/rotor/mylogfile.2019-05-31--06-48-27.log mylogfile -#> 5 /tmp/RtmpT5fN3W/rotor/mylogfile.20190531T064827.log mylogfile -#> 3 /tmp/RtmpT5fN3W/rotor/mylogfile.2019-05-31.log mylogfile -#> 4 /tmp/RtmpT5fN3W/rotor/mylogfile.2019-05.log mylogfile +#> 1 /tmp/RtmpOyN1LN/rotor/mylogfile.2019-06-17_09-55-44.log mylogfile +#> 2 /tmp/RtmpOyN1LN/rotor/mylogfile.2019-06-17--09-55-44.log mylogfile +#> 5 /tmp/RtmpOyN1LN/rotor/mylogfile.20190617T095544.log mylogfile +#> 3 /tmp/RtmpOyN1LN/rotor/mylogfile.2019-06-17.log mylogfile +#> 4 /tmp/RtmpOyN1LN/rotor/mylogfile.2019-06.log mylogfile #> sfx ext size isdir mode mtime -#> 1 2019-05-31_06-48-27 log 26 FALSE 664 2019-05-31 06:48:27 -#> 2 2019-05-31--06-48-27 log 26 FALSE 664 2019-05-31 06:48:27 -#> 5 20190531T064827 log 26 FALSE 664 2019-05-31 06:48:27 -#> 3 2019-05-31 log 26 FALSE 664 2019-05-31 06:48:26 -#> 4 2019-05 log 26 FALSE 664 2019-05-31 06:48:26 +#> 1 2019-06-17_09-55-44 log 26 FALSE 664 2019-06-17 09:55:44 +#> 2 2019-06-17--09-55-44 log 26 FALSE 664 2019-06-17 09:55:44 +#> 5 20190617T095544 log 26 FALSE 664 2019-06-17 09:55:44 +#> 3 2019-06-17 log 26 FALSE 664 2019-06-17 09:55:44 +#> 4 2019-06 log 26 FALSE 664 2019-06-17 09:55:44 #> ctime atime uid gid uname grname -#> 1 2019-05-31 06:48:27 2019-05-31 06:48:27 1000 1000 hoelk hoelk -#> 2 2019-05-31 06:48:27 2019-05-31 06:48:27 1000 1000 hoelk hoelk -#> 5 2019-05-31 06:48:27 2019-05-31 06:48:27 1000 1000 hoelk hoelk -#> 3 2019-05-31 06:48:26 2019-05-31 06:48:26 1000 1000 hoelk hoelk -#> 4 2019-05-31 06:48:26 2019-05-31 06:48:26 1000 1000 hoelk hoelk +#> 1 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk +#> 2 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk +#> 5 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk +#> 3 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk +#> 4 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk #> timestamp -#> 1 2019-05-31 06:48:27 -#> 2 2019-05-31 06:48:27 -#> 5 2019-05-31 06:48:27 -#> 3 2019-05-31 00:00:00 -#> 4 2019-05-01 00:00:00 +#> 1 2019-06-17 09:55:44 +#> 2 2019-06-17 09:55:44 +#> 5 2019-06-17 09:55:44 +#> 3 2019-06-17 00:00:00 +#> 4 2019-06-01 00:00:00 ``` If we examine the “timestamp” column in the example above, we see that missing date information is always interpreted as the start of the period; i.e. so `"2019-01"` is equivalent to `"2019-01-01--00--00--00"` -for all intentds and purposes. +for all intents and purposes. ``` r prune_backups(tf, max_backups = 0) # cleanup @@ -212,7 +212,7 @@ two non-base dependencies: - [dint](https://github.com/s-fleck/dint): A toolkit for working year-quarter and year-month dates that I am also the author of. It is used by `rotate_date()` and `rotate_time()` to deal with calendar - periods. + periods (such as weeks or months). Both packages have no transitive dependencies (i.e they do not depend on anything outside of base R) diff --git a/cran-comments.md b/cran-comments.md index 647fd37..7eb0bbf 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -7,8 +7,7 @@ ## R CMD check results -0 errors | 0 warnings | 1 note +0 errors | 0 warnings | 0 notes -* fleshed out R6 API -* fixed edge-case bug on macOS related to timezones -* new features and bugfixes +maintenance release with saner default behaviour for rotate() and backup() if +no backups exist yet diff --git a/docs/404.html b/docs/404.html index f5586eb..9795805 100644 --- a/docs/404.html +++ b/docs/404.html @@ -62,7 +62,7 @@
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 59eb8d0..63375f1 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -62,7 +62,7 @@ diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 821ca29..b57cf02 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -62,7 +62,7 @@ diff --git a/docs/authors.html b/docs/authors.html index d22ff50..aa937bf 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -62,7 +62,7 @@ diff --git a/docs/index.html b/docs/index.html index 90d7248..3b0797b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,7 +33,7 @@ @@ -109,14 +109,14 @@rotate()
also backs up a file, but replaces the original file with an empty one.
rotate(tf)
list_backups(tf)
-#> [1] "/tmp/RtmpTBrRRH/rotor/mylogfile.1.log"
-#> [2] "/tmp/RtmpTBrRRH/rotor/mylogfile.2.log.zip"
-#> [3] "/tmp/RtmpTBrRRH/rotor/mylogfile.3.log"
+#> [1] "/tmp/Rtmp9bus6U/rotor/mylogfile.1.log"
+#> [2] "/tmp/Rtmp9bus6U/rotor/mylogfile.2.log.zip"
+#> [3] "/tmp/Rtmp9bus6U/rotor/mylogfile.3.log"
# the original file is now empty
readLines(tf)
@@ -133,10 +133,10 @@
backup(tf, max_backups = 4)
list_backups(tf)
-#> [1] "/tmp/RtmpTBrRRH/rotor/mylogfile.1.log"
-#> [2] "/tmp/RtmpTBrRRH/rotor/mylogfile.2.log"
-#> [3] "/tmp/RtmpTBrRRH/rotor/mylogfile.3.log"
-#> [4] "/tmp/RtmpTBrRRH/rotor/mylogfile.4.log.zip"
We can also use prune_backups()
to delete old backups. Other than ensuring that no new backups is created, it works identically to using backup()
with the max_backups
parameter. By setting it to 0
, we delete all backups.
If we examine the “timestamp” column in the example above, we see that missing date information is always interpreted as the start of the period; i.e. so "2019-01"
is equivalent to "2019-01-01--00--00--00"
for all intentds and purposes.
If we examine the “timestamp” column in the example above, we see that missing date information is always interpreted as the start of the period; i.e. so "2019-01"
is equivalent to "2019-01-01--00--00--00"
for all intents and purposes.
rotate_date()
and rotate_time()
to deal with calendar periods.rotate_date()
and rotate_time()
to deal with calendar periods (such as weeks or months).
Both packages have no transitive dependencies (i.e they do not depend on anything outside of base R)
diff --git a/docs/news/index.html b/docs/news/index.html index 6b5cf32..5960f66 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -62,7 +62,7 @@ @@ -100,9 +100,9 @@rotate_date()
, rotate_time()
, etc…: If no backups exist of target file, use the “created” timestamp to determine whether rotation should take place or not.