Fix as jayant say.

```
cat upload.sh    
/home/Dropbox-Uploader/dropbox_uploader.sh upload  -f /home/Dropbox-Uploader/.dropbox_uploader   /home/material/*  /
date >>  /home/upload.log

```

All files in directory material can be uploaded into my dropbox with `bash upload.sh`.  

I want to write a autorun service at shutdown to upload files into dropbox.

```
vim  /etc/systemd/system/upload.service
[Unit]
Description=upload files into dropbox
Before=network.target shutdown.target  reboot.target

[Service]
ExecStart=/bin/true
ExecStop=/bin/bash  /home/upload.sh 
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

```

Enable it with:

```
sudo systemctl enable upload.service

```

To reboot it.

```
journalctl -u upload

-- Logs begin at Thu 2018-01-18 22:38:54 EST, end at Tue 2018-04-10 06:55:43 EDT. --
Apr 10 06:48:27 localhost systemd[1]: Started upload files into dropbox.
Apr 10 06:48:27 localhost systemd[1]: Starting upload files into dropbox...
Apr 10 06:48:27 localhost bash[111]: which: no shasum in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)
Apr 10 06:48:27 localhost bash[111]: > Uploading "/home/material/test.txt" to "/test.txt"...
Apr 10 06:48:27 localhost bash[111]: Error: Couldn't resolve host.

```

`ln -s /usr/bin/sha1sum /usr/bin/shasum` according to [google's result](https://github.com/portainer/portainer/issues/507).

Reboot the second time.

```
journalctl -u dropbox
Apr 10 06:55:04 localhost systemd[1]: Started upload files into dropbox.
Apr 10 06:55:04 localhost systemd[1]: Starting upload files into dropbox...
Apr 10 06:55:04 localhost bash[113]: shasum: invalid option -- 'a'
Apr 10 06:55:04 localhost bash[113]: Try 'shasum --help' for more information.
Apr 10 06:55:04 localhost bash[113]: shasum: invalid option -- 'a'
Apr 10 06:55:04 localhost bash[113]: Try 'shasum --help' for more information.
Apr 10 06:55:04 localhost bash[113]: > Uploading "/home/material/test.txt" to "/test.txt"...
Apr 10 06:55:04 localhost bash[113]: Error: Couldn't resolve host.

```

Do as Raushan say,new issue arised,

```
Uploading    by 4 chunks *** FAILED   dropbox

```

For the problem `Uploading by 4 chunks *** FAILED dropbox` ,some material say that if files exceeding 150 mb should be uploaded in chunks.

```
split -b 10m  /home/upload.tar.gz  /home/material/dropbox
ls  /home/material
dropboxaa  dropboxac  dropboxae  dropboxag  ......

```

Both of them is less than 10m.

```
journalctl -u upload
Apr 19 01:45:26 localhost systemd[1]: Started upload files into dropbox.
Apr 19 01:45:26 localhost systemd[1]: Starting upload files into dropbox...
Apr 19 01:45:27 localhost bash[401]: > Uploading "/home/material/dropboxaa" to "/dropboxaa"... FAILED
Apr 19 01:45:27 localhost bash[401]: An error occurred requesting /upload
Apr 19 01:45:28 localhost bash[401]: > Uploading "/home/material/dropboxab" to "/dropboxab"... FAILED
Apr 19 01:45:40 localhost bash[401]: Some error occured. Please check the log.
Apr 19 01:45:40 localhost systemd[1]: upload.service: main process exited, code=exited, status=1/FAILURE
Apr 19 01:45:40 localhost systemd[1]: Unit upload.service entered failed state.
Apr 19 01:45:40 localhost systemd[1]: upload.service failed.

```

Why `> Uploading "/home/material/dropboxaa" to "/dropboxaa"... FAILED`?