I would like to execute a command in bash every 30 seconds and have it run as a background job. Form this post, I gather that using the watch command is useful. However every time I attempt to background it, it stops.
watch -n 1 'date >> dateFile.txt'
works. I can
cat dateFilet.txt and see a bunch of lines.
watch -n 1 'date >> dateFile.txt' &
+ Stopped watch -n 1 'date >> dateFile.txt'
bg returns the same line again.
What am I doing wrong? How do I fix it? What I eventually want to do is source a file every minute or so to keep certain variables in my bash session up to date.