I have written a short script to upload a log to my ftp server, you can ignore everything apart from the last line which is supposed to restart rsyslog.Executing the command from the command line works fine but it doesn't work in the script file. Can anybody help ?#!/bin/bashmv /var/log/rtx8660.log /home/vocovo/RTX8660_$(date +%Y-%m-%d-%H_%M).logtouch /var/log/rtx8660.log cd /home/vocovo  FTPLOG=/tmp/ftplogfile  ftp -inv <<! > $FTPLOG  open SERVER  user USER PASS  cd /Wickes_Test  prompt  mput RTX*  close  quit  ! FTP_SUCCESS_MSG=226 Transfer complete if fgrep $FTP_SUCCESS_MSG $FTPLOG ;then echo ftp OK rm RTX* else echo ftp Error: $OUT fi exit 0 service rsyslog restart
How to restart service in bash script?
debian;rsyslog