A few tips and tricks I use to achieve tasks in low bandwidth setups.
Connect to a remote machine and run a command without waiting for output
ssh user@hostname 'command > /dev/null'
This is nice and simple but the output might be needed. In which case I'd resort to hold tricks such as using a script instead of a simple command.
ssh user@hostname 'command.sh > /dev/null'
With command.sh something like the below:
echo "$(date) Starting execution"
sleep 10; # do real work...
echo "$(date) Done"
Some more forking might be necessary in which case I recommend to look into the following syntax
long_running_command &
nohup long_running_command 2&>1 &
It can come handy to use ssh -C
to enable compression and therefore save a bit of bandwidth.
I find it annoying when connection break off, the most annoying is to loose context of what I was doing, to maintain context I like to use tmux
To start a tmux session you need to install tmux then, start a session
tmux
To view existing sessions use
tmux list-sessions
To attach to a session use
tmux at -t session_number_or_name
A common task can be to sync files between systems, scp is a great tool for a few file, however for recurrent transfers I like using rsync instead of say creating an archive and syncing over the network.
rsync -avez local remote@host:/path/to/fileShare on Twitter Share on Facebook
Comments
bilal 7 months ago
Thank you, I found this very useful
Link | Replyhotshot bald cop 2 months, 1 week ago
I was just telling my friend about that.
Link | ReplyKraig 1 month, 3 weeks ago
I didn't know that.
Link | ReplyBob 4 months, 3 weeks ago
This is great thanks
Link | ReplyNew Comment