How to handle spaces in paths with rsync on Linux?

The common rsync commands seems not handle spaces well. For example, rsync -avxP file “user@server:/data/my dir” It reports: rsync: link_stat “/home/zma/file” failed: No such file or directory (2) How to make rsync handle spaces well? You can use the –protect-args option of rsync. $ rsync –protect-args -avxP file “user@server:/data/my dir” What does –protect-args do: -s, […]

How to config Git remote server on Bitbucket or Github

For your first push with git, you may get following errors when you use github or bitbucket. $ git push No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as ‘master’. fatal: The remote end hung up unexpectedly Everything up-to-date Just run following command to set your remote […]

How to make Fedora Linux not clean some files in /tmp/?

On my Fedora 20, I find that the system automatically clean up file under /tmp/. This is convenient. However, it cause some problems for some programs. For example, HDFS puts its DataNode pid file under /tmp/ by default like After it is cleaned up, the script will consider there is no DataNode running. […]

How to email admins automatically after a Linux server starts?

Managing a cluster of servers, I would like to notified when a server is started. How to make the Linux servers email me or other admins automatically after they are started? I did this by adding a crontab entry on each servers like @reboot date | mailx -S smtp=smtp:// -s “`hostname` started” -r […]