New answers tagged

4

Your ntpdate is running before the network is up and functional. A better solution might be to use the systemd time synchronisation module rather than creating your own. Or install ntpd and let it manage your system's time.


0

Use a Process Control System for that matter. supervisord is my usual choice as it offers granular choice over several options like number of restart retries, output redirection, process grouping and launch priority, to name a few...


0

This will restart the application every time it crashes: while true do dotnet publish/TestApp.dll done More documentation


0

You could use git blame ("Show what revision and author last modified each line of a file - Annotates each line in the given file with information from the revision which last modified the line. Optionally, start annotating from the given revision.") See also this. In particular, using the -L option: -L <start>,<end> <start> and <end&...


2

Such a stupid mistake. I had 1 * extra. Instead of * * * * 6, I entered * * * * * 6.


5

You should never manually touch the files in the cron spool directory. Making changes to the files there would not notify the cron daemon properly, and updates to schedules would not become active until the daemon is restarted. (Some cron daemon implementations may periodically check the spool to see if there are updated files in there, but this behaviour ...


4

You could use a filter: git config filter.dropSecondLine.clean "sed '2d'" Edit/create .git/info/attributes and add: * filter=dropSecondLine If you don't want the filter acting on all the files in the repo, modify the * to match an appropriate pattern or filename. The effect will be the working directory will remain the same, but the repo blobs will not ...


1

Unfortunately, when you give both a day-of-month and a day-of-week in a crontab entry, this means either one is sufficient. (Didn't know that either, but the manpage says so.) This means we can't simply calculate that the 3rd friday is a friday that is between the 15th and 21st of the month. Fortunately, the above-linked man page also advises us: One ...


6

The backslashes do nothing. The - and + characters do not need to be escaped, because they are not special in any way in the syntax of any shell. $ set -o xtrace $ date +%F-%T + date +%F-%T 2019-08-15-11:51:46 $ date \+%F\-%T + date +%F-%T 2019-08-15-11:51:50 As you can see in the above trace output, the command that gets executed by the shell is the ...


0

Write a script and set it to run with cron jobs or systemd timers. Include the appropriate tar command in the script and use the exclude flag for tar to avoid taring the /tar/bkp folder. And use find with the -mmin 120 flag to limit the files tarred to files modified in the last 120 minutes. For example: #!/bin/bash source='/kit' dest='/kit/bkp' find "${...


0

find your_path -t f -mmin 5 -exec tar -zcvf your_compress_file.tar.gz {} + You can make an script and put your script into crontab.


0

After a couple of days I managed to answer my own question. In hindsight it was quite simple. Responsiveness: The slurmd daemon can be started with command line arguments, list them with slurmd -h. In particular , slurmd -n 19 sets the highest nice-value (and thus lowest priority) for the daemon and all its subprocesses. On desktop computers, I simply ...


0

Suppose your script is called monitor.sh. There are many commands you can use on linux to send the email. For example with mail command: mail -s "Monitor Report" admin@example.com < <( bash monitor.sh ) With sendmail: echo "Subject: Monitor Report" | sendmail -v admin@example.com < <( bash monitor.sh ) With ssmtp: ssmtp admin@example.com &...


3

tput bold writes the character sequence that is to be used to tell the current terminal it is running in to start writing in bold. It knows the type of the terminal based on the value of the $TERM environment variable. That variable is set by terminal emulators or by getty. tput queries the termcap or terminfo databases to know what sequence to use for a ...


2

Your script is running just fine, but it writes to a file called test.log in the current directory. Since you never cd in your script, the current directory technically be anywhere, but it's most likely the user's home directory. To write to test.log located elsewhere, either cd to the correct directory in the script, or provide the full path to the test....


1

crontab runs scripts in a different environment from login shell; in particular, PATH could be different or undefined. Try to use absolute path on the commands (lynx, head ...) You can get them with which <command> Moreover you should specify path for test.log.


1

docker-compose can not be found in cron users PATH variable, and therefore can not be run. One way to fix this is to provide the complete path to the binary. 0 0 * * * cd /home/ec2-user/myapp && /usr/local/bin/docker-compose up


2

You probably shouldn't overcomplicate the regex. To remove any possible hashtags at the beginning of lines containing the string run_all.sh, you could do: crontab -l | sed 's/^#*\(.*run_all\.sh\)/\1/' | crontab - Unfortunately, I don't have a Solaris system at hand to test it.


0

You wish to delete a particular crontab entry and replace it with another. You may dump the existing crontab schedule to a text file using crontab -l >crontab-old.txt Assuming that you know that the existing crontab entry is exactly */15 * * * * /bin/sh /opt/myscript/myscript.sh > /tmp/myscript.check.out (with no additional spaces anywhere) you ...


0

Files with extension .ffs_batch are an xml text associated with FreeFileSync app. Therefore, there are two correct ways to program it in cron (crontab -e): export DISPLAY=:0; /path_to/FreeFileSync /path_to/file.ffs_batch or /path_to/FreeFileSync /path_to/file.ffs_batch --display=:0.0 The error "Unable to initialize GTK +, is DISPLAY set properly?" it is ...


Top 50 recent answers are included