.\" Copyright (c) 1995, 1996 .\" Ikuo Nakagawa. All rights reserved. .\" .Dd March 10, 1996 .Dt ROTATE 1 .Os BSD 4.4 .Sh NAME .Nm rotate .Nd rotate files with suffixes .Sh SYNOPSIS .Nm rotate .Op Fl g Ar group .Op Fl o Ar owner .Op Fl m Ar mode .Op Fl n .Op Fl v .Op Fl z .Op Fl Z .Ar target .Ar suffix \&... .Sh DESCRIPTION .Nm Rotate tries to rotate the target files with given suffixes (or .Dq .old if omitted), and creates an empty one. .Pp .Bl -tag -width Ds .It Fl g Ar group Specify a group. .It Fl o Ar owner Specify an owner. .It Fl m Ar mode Specify an alternate mode. The default mode is set to 0666 as modified by the current umask(2). .It Fl n Print what .Nm rotate will do, but does nothing. .It Fl v Verbose mode. Show various messages. .It Fl Z Compress target file by compress(1). .It Fl z Same as .Fl Z but using gzip(1). .El .Pp Upon successful completion a value of 0 is returned. Otherwise, a value of 1 is returned. .Pp .Nm Rotate is useful to rotate syslog messages, for example: .Bd -literal -offset indent rotate -o root -g wheel -m 640 /var/log/messages 2 1 0 .Ed .Pp To rotate uucp logs with .Dq .old .Bd -literal -offset indent rotate -o uucp -g uucp -m 640 -z /var/spool/uucp/Log .Ed .Pp You can also rotate log files with date specific suffix: .Bd -literal -offset indent rotate -o root -m 600 /var/log/maillog `date +%Y%m%d` .Ed .Sh SEE ALSO .Xr install 1 , .Xr chgrp 1 , .Xr chmod 1 , .Xr compress 1 , .Xr cp 1 , .Xr gzip 1 , .Xr mv 1 , .Xr umask 2 , .Xr chown 8 .Sh BUGS When .Nm rotate rotates .Dq foo to .Dq foo.suffix , .Dq foo.Z and .Dq foo.gz are also rotated if exist, even though you do not want it. .Sh HISTORY The .Nm rotate was written by Ikuo Nakagawa.