# Append current date to the filename via Cron?

**URL:** <https://forum.hestiacp.com/t/append-current-date-to-the-filename-via-cron/2447>\
**Category:** Cron Jobs\
**Created:** [December 31, 2020, 12:41pm UTC](https://forum.hestiacp.com/t/append-current-date-to-the-filename-via-cron/2447 "2020-12-31T12:41:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrTux](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/mrtux/32/1086_2.png) [@MrTux](https://forum.hestiacp.com/u/MrTux)\
**Post date:** [December 31, 2020, 12:41pm UTC](https://forum.hestiacp.com/t/append-current-date-to-the-filename-via-cron/2447/1 "2020-12-31T12:41:32Z")

</div>

In the Cron Job section, if a variable is inserted, the Cron Job cannot be modified, it is no longer visible and does not work. Is there a way to insert variables like from the command line with crontab -e?

```
bash /home/user/bash/script.sh > /home/user/log/script_$(date +\%Y\%m\%d).log

```

---

<div class="post-metadata">

**Author:** ![nboy](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/n/439d5e/32.png) [@nboy](https://forum.hestiacp.com/u/nboy)\
**Post date:** [December 31, 2020, 2:45pm UTC](https://forum.hestiacp.com/t/append-current-date-to-the-filename-via-cron/2447/2 "2020-12-31T14:45:21Z")

</div>

This query better suits in stackexchange…

> <https://unix.stackexchange.com/questions/29578/how-can-i-execute-date-inside-of-a-cron-tab-job>

---

<div class="post-metadata">

**Author:** ![MrTux](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/mrtux/32/1086_2.png) [@MrTux](https://forum.hestiacp.com/u/MrTux)\
**Post date:** [December 31, 2020, 6:27pm UTC](https://forum.hestiacp.com/t/append-current-date-to-the-filename-via-cron/2447/3 "2020-12-31T18:27:35Z")

</div>

In the HestiaCP Cron Job section the insertion of variables is not allowed. After saving if you reopen the cron job it disappears.
