Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
linux:pipe [2020/09/16 11:24] – [Execution Dependency] tmadelinux:pipe [2022/02/16 04:34] – [Error-handling] tmade
Line 18: Line 18:
  
   ls /opt/ /otherfile > file 2>&         #Redirect standard error output and standard output and to "file"   ls /opt/ /otherfile > file 2>&         #Redirect standard error output and standard output and to "file"
 +  sudo -lU ${USER} > /dev/null 2>&       #Redirect standard error output and standard output and to "/dev/null"
 +  ls /opt /otherfile 2> /dev/null          #Redirect standard error output to /dev/null       
   programm &> file                         #Redirect stdout AND stderr to "file"   programm &> file                         #Redirect stdout AND stderr to "file"
   echo "This is a test" 1> /dev/null       #Redirects standard output to /dev/null   echo "This is a test" 1> /dev/null       #Redirects standard output to /dev/null
Line 37: Line 39:
 To check if a process is running/ return code: To check if a process is running/ return code:
  
-SERVICE_NAME=apache2 +  SERVICE_NAME=apache2 
-  +
   (ps -ef | grep $SERVICE_NAME  | grep -v grep && echo "$SERVICE_NAME is running") || echo "$SERVICE_NAME is not running"   (ps -ef | grep $SERVICE_NAME  | grep -v grep && echo "$SERVICE_NAME is running") || echo "$SERVICE_NAME is not running"
   ps -ef | grep $SERVICE_NAME | grep -v grep && RESULT=running || RESULT=error   ps -ef | grep $SERVICE_NAME | grep -v grep && RESULT=running || RESULT=error
Line 51: Line 53:
 </code> </code>
   innobackupex --apply-log $TARGET_FOLDER && /bin/echo "`/bin/date +'%d-%m-%Y %H:%M:%S'`: Backup successful." >> $BACKUPLOG || /bin/echo "`/bin/date +'%d-%m-%Y %H:%M:%S'`: Backup failed." >> $ERRLOGFILE   innobackupex --apply-log $TARGET_FOLDER && /bin/echo "`/bin/date +'%d-%m-%Y %H:%M:%S'`: Backup successful." >> $BACKUPLOG || /bin/echo "`/bin/date +'%d-%m-%Y %H:%M:%S'`: Backup failed." >> $ERRLOGFILE
-   
-  cp -a $(ls /var/log/nginx/*access.log.* | grep -E 'access\.log\.[1-3](\.gz)?$') /mnt/serverlogs/lb-web/ 
      
 ==== Pipe to a programm ==== ==== Pipe to a programm ====
linux/pipe.txt · Last modified: 2022/02/16 04:34 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki