O que é o formato de ficheiro TIMER?
Um arquivo .timer é uma unidade de temporizador usada pelo systemd, o sistema de inicialização e gerenciador de serviços por trás da maioria das distribuições Linux. Ele agenda quando outra unidade deve ser executada, geralmente um arquivo .service correspondente, e atua como um substituto moderno para o cron. O arquivo é um texto simples em UTF-8 no estilo INI, portanto, contém um agendamento em vez de código de programa.
Cada temporizador normalmente faz par com um serviço de mesmo nome base. Um arquivo chamado backup.timer aciona o backup.service, a menos que sua diretiva Unit= nomeie um alvo diferente. A unidade é organizada em três seções: [Unit] para a descrição e dependências, [Timer] para o agendamento e [Install] para ativação através de WantedBy=timers.target.
Os agendamentos vêm em duas formas. Temporizadores de tempo real usam OnCalendar= para disparar em eventos de calendário, da mesma forma que uma tarefa cron faz. Temporizadores monotônicos, como OnBootSec= ou OnUnitActiveSec=, disparam após um intervalo definido após um evento de referência, como a inicialização ou a última execução. Opções como Persistent=true recuperam uma execução perdida após a máquina ter sido desligada, e RandomizedDelaySec= distribui a carga entre muitos hosts.
Segurança e proteção
RISCO: LOWA .timer file is plain text with no executable code, so opening it in an editor is safe. The real consideration is trust: a timer can schedule any system command through its paired service, so only install units from sources you trust and review them before enabling with systemctl.
Detalhes do formato
em resumo- Construct 2/3 timer behavior data - Some game and animation tools store timer state, but this is not the dominant meaning of the extension.
- Generic application timer/config data - A few niche programs write settings files named with a .timer suffix; these are unrelated to systemd.
Programas que abrem arquivos TIMER
.timer file on a workstation before copying it to a Linux host; opens as plain text with optional systemd/INI highlighting. .timer unit as text before deploying it to a Linux server. vim /etc/systemd/system/name.timer; syntax highlighting for systemd units ships with Vim. nano /etc/systemd/system/name.timer; run systemctl daemon-reload afterward to apply changes. systemctl enable --now name.timer, inspect the schedule with systemctl list-timers, and check status with systemctl status name.timer. systemctl edit name.timer and validate its calendar expression using systemd-analyze calendar "OnCalendar-string". .timer file as a plain-text unit; the systemd/INI extensions add highlighting and directive hints. Detalhes técnicos
especificação profunda| Encoding | UTF-8 plain text |
| Byte order | Not applicable (text) |
| Container | None; INI-style key=value sections |
| Typical size | Under 1 KB |
| Structure | Three sections: [Unit] for description and dependencies, [Timer] for the schedule (OnCalendar, OnBootSec, OnActiveSec, OnUnitActiveSec, OnStartupSec, OnUnitInactiveSec, AccuracySec, RandomizedDelaySec, Persistent, Unit), and [Install] for enablement via WantedBy=timers.target. |
| Integrity | None built in |
| Platforms | Linux |
| Notes | Each .timer file normally pairs with a same-named .service file (foo.timer triggers foo.service unless Unit= overrides). Timers come in realtime (calendar) and monotonic (relative to boot, activation, or last run) forms and serve as a cron alternative managed through systemctl and logged to the systemd journal. |
| File Locations | System units in /usr/lib/systemd/system/ (packaged) and /etc/systemd/system/ (admin overrides); user units in ~/.config/systemd/user/ and /etc/systemd/user/. |
| Line Endings | Unix LF |
| Lançado | 2012 (systemd timer units) |
| Padrão aberto | Sim · livre de royalties |
| Especificação | man7.org |
Conversões de TIMER
Perguntas e Respostas da Comunidade
perguntado por usuáriosAinda não há perguntas - seja o primeiro a perguntar sobre arquivos TIMER.
Perguntas frequentes
Como faço para abrir um arquivo .timer?
nano, vim, VS Code ou Notepad++. É um pequeno arquivo de texto simples, portanto, nenhum software especial é necessário para lê-lo.Qual é a diferença entre um arquivo .timer e um arquivo .service?
.service define o que executar; um arquivo .timer define quando executá-lo. Um temporizador chamado backup.timer ativa o backup.service, a menos que sua diretiva Unit= diga o contrário.Como habilito e inicio um temporizador?
/etc/systemd/system/, execute systemctl daemon-reload e, em seguida, systemctl enable --now name.timer. Verifique-o com systemctl list-timers.Os temporizadores do systemd são melhores que o cron?
Persistent=true. O cron é mais simples e mais portátil entre sistemas Unix. Ambos são válidos; os temporizadores são comuns no Linux moderno.Por que meu temporizador não está disparando?
systemctl status name.timer, se existe um serviço correspondente e se a expressão OnCalendar= é válida. Teste a expressão com systemd-analyze calendar "sua-string".