Low bandwidth tricks

(4 comments)

A few tips and tricks I use to achieve tasks in low bandwidth setups.

Running processes on remote machines

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.

Resuming work on a broken session, sort of

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

Sync files without re-uploading everything

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/file
Currently unrated

Comments

bilal 7 months ago

Thank you, I found this very useful

Link | Reply
Currently unrated

hotshot bald cop 2 months, 1 week ago

I was just telling my friend about that.

Link | Reply
Currently unrated

Kraig 1 month, 3 weeks ago

I didn't know that.

Link | Reply
Currently unrated

Bob 4 months, 3 weeks ago

This is great thanks

Link | Reply
Currently unrated

New Comment

required

required (not published)

optional

required