FG
💻 Software

Is it possible to use variables in crontab -e?

Fresh5 days ago
Mar 15, 202623053 views
Confidence Score0%
0%

Problem

Can I say: in ? Is it possible to use variables in ?

Error Output

MYPATH=/root/scripts  
MYSCRIPT=doit.sh

0 1 * * * $MYPATH/$MYSCRIPT

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Is it possible to use variables in crontab -e?

Low Risk

Yes, you can define and use variables in this way. There's a limitation (which you haven't hit in your examples): the string on the right of the sign is interpreted literally, with leading spaces removed, so you can't use constructs like (e.g. won't…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment