Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying this command

tar cvpzf /TEMP_BACKUPS/backup.tgz --exclude=/proc --exclude=/lost+found  --exclude=/tmp --exclude=/TEMP_BACKUPS --exclude=/mnt --exclude=/sys / > /TEMP_BACKUPS/mylog.txt

and i am getting this error. I have tried twice

tar: Removing leading `/' from member names
tar: /dev/log: socket ignored
tar: Removing leading `/' from hard link targets
tar: /selinux/policy: Cannot open: Invalid argument
tar: /var/spool/postfix/public/flush: socket ignored
tar: /var/spool/postfix/public/cleanup: socket ignored
tar: /var/spool/postfix/public/showq: socket ignored
tar: /var/spool/postfix/private/defer: socket ignored
tar: /var/spool/postfix/private/virtual: socket ignored
tar: /var/spool/postfix/private/proxywrite: socket ignored
tar: /var/spool/postfix/private/verify: socket ignored
tar: /var/spool/postfix/private/anvil: socket ignored
tar: /var/spool/postfix/private/lmtp: socket ignored
tar: /var/spool/postfix/private/bounce: socket ignored
tar: /var/spool/postfix/private/relay: socket ignored
tar: /var/spool/postfix/private/scache: socket ignored
tar: /var/spool/postfix/private/retry: socket ignored
tar: /var/spool/postfix/private/error: socket ignored
tar: /var/spool/postfix/private/rewrite: socket ignored
tar: /var/spool/postfix/private/tlsmgr: socket ignored
tar: /var/spool/postfix/private/local: socket ignored
tar: /var/spool/postfix/private/discard: socket ignored
tar: /var/spool/postfix/private/trace: socket ignored
tar: /var/spool/postfix/private/smtp: socket ignored
tar: /var/spool/postfix/private/proxymap: socket ignored
tar: /var/lib/mysql/mysql.sock: socket ignored
tar: /var/www/html/run/wsgi.1458.0.1.sock: socket ignored
tar: /var/www/html/run/wsgi.4861.1.1.sock: socket ignored
tar: /var/www/html/run/wsgi.1178.0.1.sock: socket ignored
tar: /var/www/html/run/wsgi.1179.0.1.sock: socket ignored
tar: /var/run/dbus/system_bus_socket: socket ignored
tar: /var/run/abrt/abrt.socket: socket ignored
tar: /var/run/rpcbind.sock: socket ignored
tar: /var/run/portreserve/socket: socket ignored
tar: /var/run/nscd/socket: socket ignored
tar: Exiting with failure status due to previous errors

what do i need to do to make full backup

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Note that your tar command is completing successfully; it's just complaining about the socket entries. Tiffany is suggesting a mechanism for filtering out those particular error messages, although tar will still exit with an error code.

You could also feed a list of sockets to tar's -X option to have them excluded from the backup, e.g:

# find / -type s -print > /tmp/sockets-to-exclude
# tar cvpzf /TEMP_BACKUPS/backup.tgz -X /tmp/sockets-to-exclude \
  --exclude=/proc --exclude=/lost+found  --exclude=/tmp \
  --exclude=/TEMP_BACKUPS --exclude=/mnt --exclude=/sys / > /TEMP_BACKUPS/mylog.txt

The advantage to this technique is that it makes tar's exit code more useful (that is, you can use the exit code to decide whether or not the backup completed successfully).

You could also shorten your command line by replacing your other --exclude options with a single -X (aka --exclude-from) and simply listing them in a file.

share|improve this answer
    
thanks buddy , i got it –  user1865341 Jul 24 '13 at 3:33
add comment

Sockets are zero level files that are used by daemon processes to communicate with each other. They are created and destroyed as necessary when the daemons start and stop. They can safely be ignored.

You can always get rid of them with tar <my_options> 2> >(grep -v 'socket ignored' >&2)

share|improve this answer
    
i didn't understand , do u mean that by ignoring sockets , will my tar run ok without exiting –  user1865341 Jul 24 '13 at 3:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.