Skip to content

Instantly share code, notes, and snippets.

@mylamour
Last active January 2, 2017 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mylamour/7107939005fbaa27ad8f47a8cec95254 to your computer and use it in GitHub Desktop.
Save mylamour/7107939005fbaa27ad8f47a8cec95254 to your computer and use it in GitHub Desktop.
use crontab to define a event and exec every second , it's simply like a log count
  • use crontab -e to define a event every minuter,due to the script was exahust 1 min , so it's mean this log can be ouput every second
  • and you can see what you want , just change the listEverySecond.sh , you can easyliy get file info , and something else
  1. just insert this string : */1 * * * * /bin/bash ~/listEverySecond.sh >> cat.log
  2. just make a test, in your dest dir : wget -m -p -c http://your.test.domain.name
  3. log view (In a new terminal window) : tail -f cat.log
#!/bin/bash
step=1
for (( i = 0; i < 60; i=(i+step) )); do
# ls ~/tmp/test/ | wc -l
# ls ~/tmp/test/ | grep -E "html\."
ls -R ~/jav/ | wc -l
sleep $step
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment