# Endup file : executing automatically a piece of code ending Julia

**URL:** <https://discourse.julialang.org/t/endup-file-executing-automatically-a-piece-of-code-ending-julia/62384>\
**Category:** Tooling\
**Tags:** ijulia\
**Created:** [June 4, 2021, 9:34am UTC](https://discourse.julialang.org/t/endup-file-executing-automatically-a-piece-of-code-ending-julia/62384 "2021-06-04T09:34:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aitzkora](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aitzkora/32/14610_2.png) [@aitzkora](https://discourse.julialang.org/u/aitzkora)\
**Post date:** [June 4, 2021, 9:34am UTC](https://discourse.julialang.org/t/endup-file-executing-automatically-a-piece-of-code-ending-julia/62384/1 "2021-06-04T09:34:30Z")

</div>

Hi,  
Is there any mechanism like startup.jl to execute some code but instead at the beginning of julia REPL execute that code when closing the REPL. Indeed with the lack of support of history saving in IJulia, I want to automatically save all lines of my history in a file when closing my kernel. Is there anybody aware of such mechanism  
Per advance, thanks

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [June 4, 2021, 11:15am UTC](https://discourse.julialang.org/t/endup-file-executing-automatically-a-piece-of-code-ending-julia/62384/2 "2021-06-04T11:15:45Z")

</div>

I only use the repl, but that automatically saves everything to `~/.julia/logs/repl_history.jl`. Is there nothing like that for ijulia?

---

<div class="post-metadata">

**Author:** ![aitzkora](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aitzkora/32/14610_2.png) [@aitzkora](https://discourse.julialang.org/u/aitzkora)\
**Post date:** [June 4, 2021, 11:51am UTC](https://discourse.julialang.org/t/endup-file-executing-automatically-a-piece-of-code-ending-julia/62384/3 "2021-06-04T11:51:15Z")

</div>

I was not aware of this file. I made a test and sadly IJulia does not save anything in this file. I use IJulia trough jupyter console to have vim shortcurts.

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [June 4, 2021, 2:19pm UTC](https://discourse.julialang.org/t/endup-file-executing-automatically-a-piece-of-code-ending-julia/62384/4 "2021-06-04T14:19:41Z")

</div>

Seems there is a very old issue on the topic in the IJulia repo, [implement saved history for consoles · Issue #47 · JuliaLang/IJulia.jl · GitHub](https://github.com/JuliaLang/IJulia.jl/issues/47)

Maybe add a comment there to see if anyone wants to have a look at it.
