订阅内容

Timewarrior is an open source tool that tracks time from the command line. And in this article, I show you how it comes in handy.

My guess is that many sysadmins share the need to spend a specific amount of time on certain projects. For example, let's say I have a contract to work 40 hours a week doing virtualization and cloud computing stuff for 50% of the time, spending 30% of the time on Linux, and another 20% on firewall and load-balancing. Well, that's the plan, at least. To see how this plays out in reality, I need a tool to track my time on these tasks. The tool has to be quick and easy to use, so I don't waste time tracking instead of working.

Prepare the stage for Timewarrior - a tool that I feel is of so much help that I wish I had known it far earlier.

Looking for the full documentation? You'll find it at the Timewarrior web site.

Possible use cases

Nothing is as helpful as some real-world use cases. I'll show you some of mine.

As simple as a stopwatch

To record some random activity, you could use Timewarrior as a simple stopwatch. As you begin the activity, you start the clock:

$ timew start
Tracking
Started 2020-08-19T08:18:23
Current 23
Total 0:00:00
$ timew stop
Recorded
Started 2020-08-19T08:18:23
Ended 20:49
Total 0:02:26

When you're finished with the activity, stop the clock and find the time spent printed to stdout.

[ Readers also enjoyed: Linux sysadmin basics: User account management ]

Track reoccurring activities using tags

To track time spent on activities like Meetings, Linux, or Firewall, I use tags which I append to the timew start command. Please look at the following code blocks carefully to understand how this works.

Start the Meeting:

$ timew start Meeting
Tracking Meeting
Started 2020-08-21T10:56:24
Current 24
Total 0:00:00

Start the Virtualization task:

$ timew start Virtualization
Recorded Meeting
Started 2020-08-21T10:56:24
Ended 57:19
Total 0:00:55
Tracking Virtualization
Started 2020-08-21T10:57:19
Current 19
Total 0:00:00

Start Meeting:

$ timew start Meeting
Recorded Virtualization
Started 2020-08-21T10:57:19
Ended 58
Total 0:00:39
Tracking Meeting
Started 2020-08-21T10:57:58
Current 58
Total 0:00:00

Start Linux:

$ timew start Linux
Recorded Meeting
Started 2020-08-21T10:57:58
Ended 58:35
Total 0:00:37
Tracking Linux
Started 2020-08-21T10:58:35
Current 35
Total 0:00:00

Stop tasks:

$ timew stop
Recorded Linux
Started 2020-08-21T10:58:35
Ended 11:00:25
Total 0:01:50

Display the summary:

$ timew summary
Wk Date Day Tags Start End Time Total
W34 2020-08-21 Fri Verw. 6:41:58 6:43:16 0:01:18
Virtualization 6:43:16 6:48:05 0:04:49
Sysmaster 6:48:05 6:50:44 0:02:39
Meeting 10:56:24 10:57:19 0:00:55
Virtualization 10:57:19 10:57:58 0:00:39
Meeting 10:57:58 10:58:35 0:00:37
Linux 10:58:35 11:00:25 0:01:50 0:12:47

Depending on your terminal settings the output looks much nicer as the screenshot from a gnome-terminal should illustrate.

time warrior output

With timew summary, you get the summary for your current day. As you see, I worked in the early morning today, which I had almost forgotten already.

Would you like to know more about Timewarrior's reporting functionality? Look at the documentation.

[ Free cheat sheet: IT job interview tips

Wrap up

Timewarrior is an awesome tool that helps me track time spent on different projects quickly and easily. This information helps to determine whether one person's time is enough to deal with all the work for one task or if more resources are needed to get the job done.


关于作者

Jörg has been a Sysadmin for over ten years now. His fields of operation include Virtualization (VMware), Linux System Administration and Automation (RHEL), Firewalling (Forcepoint), and Loadbalancing (F5). He is a member of the Red Hat Accelerators Community and author of his personal blog at https://www.my-it-brain.de.

Read full bio
UI_Icon-Red_Hat-Close-A-Black-RGB

按频道浏览

automation icon

自动化

有关技术、团队和环境 IT 自动化的最新信息

AI icon

人工智能

平台更新使客户可以在任何地方运行人工智能工作负载

open hybrid cloud icon

开放混合云

了解我们如何利用混合云构建更灵活的未来

security icon

安全防护

有关我们如何跨环境和技术减少风险的最新信息

edge icon

边缘计算

简化边缘运维的平台更新

Infrastructure icon

基础架构

全球领先企业 Linux 平台的最新动态

application development icon

应用领域

我们针对最严峻的应用挑战的解决方案

Original series icon

原创节目

关于企业技术领域的创客和领导者们有趣的故事