erraid & tadmor is a Unix-style task scheduler system similar to cron, allowing users to automate the execution of complex commands (simple commands, sequences, pipelines, and conditionals) at specified times. The system consists of a daemon (erraid) that executes tasks and a client (tadmor) that manages them.
- Complex Command Support: Execute simple commands, sequences (
;), pipelines (|), conditionals (if-then-else, &&, ||) - Flexible Scheduling: Cron-like scheduling with minute, hour, and day-of-week specifications
- Persistent Storage: Task definitions and execution history stored on disk for recovery after restarts
- Nested Pipelines: Support for pipelines containing sequences and nested pipelines
- Execution History: Track exit codes and capture stdout/stderr for each task execution
- Named Pipe Communication: Client-daemon communication via FIFOs for reliable IPC
- Language: C
- System Calls:
fork(),execve(),pipe(),dup2(),waitpid(),open(),read(),write() - IPC: Named pipes (FIFOs) for client-daemon communication
- Build System: GNU Make
- Serialization: Custom binary format with big-endian encoding
- A POSIX-compliant Unix-like system (tested on Linux/macOS)
gccorclangcompilermakebuild tool- Standard C library and POSIX headers
-
Clone the repository:
git clone <repository-url> cd SY5-Projet
-
Build the project:
make
This creates both
erraidandtadmorexecutables in the root directory. -
Clean build artifacts:
make distclean
-
Start the daemon (in foreground for testing):
./erraid -F -I -R /tmp/my-erraid
-F: Run in foreground (no daemonization)-I: Execute tasks immediately (for testing)-R: Specify run directory
-
Create a task (in another terminal):
./tadmor -c echo Hello, World!
This creates a task that runs every minute.
-
List tasks:
./tadmor -l
-
View execution history:
./tadmor -x <TASKID>
# Simple command (runs every minute)
./tadmor -c echo Hello
# Scheduled task (runs at 9:00 AM every day)
./tadmor -c -H 9 date
# Sequence of commands
./tadmor -s 81 82 83
# Pipeline
./tadmor -p 85 86 87
# Conditional if-then-else
./tadmor -i 88 89 90
# Conditional &&
./tadmor -A 92 93 94
# Conditional ||
./tadmor -O 96 97# List all tasks
./tadmor -l
# View exit codes history
./tadmor -x 42
# View last stdout
./tadmor -o 42
# View last stderr
./tadmor -e 42
# Remove a task
./tadmor -r 42
# Stop the daemon
./tadmor -qThe system follows a modular architecture with clear separation of concerns:
graph TD
Client["tadmor<br/>(Client)"] -->|Named Pipes| Daemon["erraid<br/>(Daemon)"]
Daemon -->|Reads| Tasks["Task Directory<br/>(Disk Storage)"]
Daemon -->|Executes| Commands["Command Execution<br/>(fork/exec)"]
Daemon -->|Writes| Logs["Execution Logs<br/>(stdout/stderr)"]
- Parser: Deserializes binary task definitions from disk
- Executor: Handles command execution with proper pipe management
- Daemon Loop: Monitors timing and executes tasks at scheduled times
- Communication: FIFO-based protocol for client requests and daemon responses
- CMD_SI: Simple command (e.g.,
echo hello) - CMD_SQ: Sequence (e.g.,
cmd1 ; cmd2 ; cmd3) - CMD_PL: Pipeline (e.g.,
cmd1 | cmd2 | cmd3) - CMD_IF: Conditional (e.g.,
if cmd1 ; then cmd2 ; else cmd3 ; fi) - CMD_ND: Conditional (e.g.,
cmd1 && cmd2 && cmd3) - CMD_OR: Conditional (e.g.,
cmd1 || cmd2 || cmd3)
SY5-Projet/
├── code/
│ ├── erraid/ # Daemon source code
│ │ ├── src/ # Implementation
│ │ ├── include/ # Header files
│ │ └── Makefile # Build configuration
│ └── tadmor/ # Client source code
│ ├── src/
│ ├── include/
│ └── Makefile
├── docs/
│ └── ARCHITECTURE.md # Detailed architecture documentation
├── sujet/ # Project specifications (French)
│ ├── enonce.md # Main specification
│ ├── protocole.md # Communication protocol
│ └── serialisation.md # Binary format specification
└── Makefile # Root build file
# Build only erraid
cd code/erraid && make
# Build only tadmor
cd code/tadmor && makeRun the daemon with debug output:
./erraid -F -d -R /tmp/my-erraidTest files are located in test_git/:
cd test_git
./autotests.sh- Architecture: See
docs/ARCHITECTURE.mdfor detailed design decisions - Specifications: See
sujet/directory for complete project requirements (in French) - Protocol: See
sujet/protocole.mdfor client-daemon communication format - Serialization: See
sujet/serialisation.mdfor binary data format
- Iyan Nazarian
- Theo Polgar
- Florian Vincent
This project is the final project of the Systems Course at Paris Cité (L3 Informatique - Système).